Closed orta closed 10 years ago
@orta Nice work!!!
I've not got the bandwidth to fully test at the moment as I don't have any projects with enough storyboard usage to make it worthwhile running the tool :(
Only question I have is what the reasoning behind the -w
flag choice is?
I couldn't do -sw
and -s
was already taken, so w
was next in line, nothing too special.
I have no other apps with Storyboards, so I'm in a similar position :D
I'd love to test this out, I just ran into this project thanks to @orta's tweet :)
But it's currently not working for me after gem install sbconstants
:
(erb):2:in `method_missing': undefined local variable or method `head' for #<SBConstants::ConstantWriter:0x007f9e6399a9b8> (NameError)
from /Users/NachoSoto/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/erb.rb:850:in `eval'
from /Users/NachoSoto/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/erb.rb:850:in `result'
from /Users/NachoSoto/.rvm/gems/ruby-2.1.0/gems/sbconstants-0.0.4/lib/sbconstants/constant_writer.rb:32:in `template_with_file'
from /Users/NachoSoto/.rvm/gems/ruby-2.1.0/gems/sbconstants-0.0.4/lib/sbconstants/constant_writer.rb:22:in `header'
from /Users/NachoSoto/.rvm/gems/ruby-2.1.0/gems/sbconstants-0.0.4/lib/sbconstants/constant_writer.rb:13:in `write'
from /Users/NachoSoto/.rvm/gems/ruby-2.1.0/gems/sbconstants-0.0.4/lib/sbconstants/cli.rb:59:in `write'
from /Users/NachoSoto/.rvm/gems/ruby-2.1.0/gems/sbconstants-0.0.4/lib/sbconstants/cli.rb:18:in `run'
from /Users/NachoSoto/.rvm/gems/ruby-2.1.0/gems/sbconstants-0.0.4/lib/sbconstants/cli.rb:8:in `run'
from /Users/NachoSoto/.rvm/gems/ruby-2.1.0/gems/sbconstants-0.0.4/bin/sbconstants:5:in `<top (required)>'
from /Users/NachoSoto/.rvm/gems/ruby-2.1.0/bin/sbconstants:23:in `load'
from /Users/NachoSoto/.rvm/gems/ruby-2.1.0/bin/sbconstants:23:in `<main>'
from /Users/NachoSoto/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
from /Users/NachoSoto/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'
^ that error @NachoSoto is why I moved it to use @head
You can my version in your gemfile, and do a bundle exec
( see this PR for how I do it: https://github.com/artsy/eidolon/pull/28/files )
Seems to work fine :)
I've switched the swift enums to public, turns out that's pretty useful in trying to do anything.
I've removed dashes from constant names too. Would you like me to take over maintaining this project?
@orta I have no issue with you taking over maintenance - rather swamped with other commitments currently. What do we need to do?
It's pretty easy, I'll need to be added as a gem admin, and have collaborator access to this repo.
gem owner sbconstants -a [first_name].therox@gmail.com
should do the ruby bit, and the github stuffs easy.
@orta done - let me know if you have any issues
awesome, I've merged in #3 and updated the README with more examples. Merging.
I want to use this in artsy/eidolon but I want to keep it as swifty as possible.
So I've added another flag to add support for outputting as swift and updated the README. You had a lot of training whitespace, so my editor cleaned those up as I was digging around in the source.
When I tried to just run it from master I couldn't get the templates to run, so I made the head / body instance vars because I couldn't figure out how the data gets passed through. Good old ruby.
Looks like this:
random side-note, I also spent 2 years in the 3 years ago :)