`configs' will be removed with next update (v1.24).
Do not use `configs' which is used by RubyMotion internal
It seems like it crashes the specs:
[master ✔] ➜ rake spec output=test_unit
undefined method `setup_blocks' for #<Motion::Project::Config:0x007fd78b628f58>
(See full trace by running task with --trace)
Oh, sorry. `setup_blocks' method will be added by v1.24.
RubyMotion v1.24 is not release yet. but it will be release soon.
Okay sure,. Is there a way we can add a check if the RM version is >= 1.24 and based on that use the appropriate accessor?
Which one do you like?
diff --git a/lib/bubble-wrap/ext/motion_project_app.rb b/lib/bubble-wrap/ext/motion_project_app.rb
index 28e8f24..1d303f9 100644
@@ -11,8 +11,12 @@ module BubbleWrap
app.frameworks = ::BubbleWrap::Requirement.frameworks(app.frameworks)
block.call(app) unless block.nil?
- configs.each_value &bw_config
+ config.setup_blocks << bw_config
+ configs.each_value &bw_config
alias :setup_without_bubblewrap :setup
alias :setup :setup_with_bubblewrap
I think that No.3 is best select :)
I would say option 2 + a warning to the user.
Some newer RM versions had introduced some bugs, and most likely some production apps are sticked to a specific RM version (an older one).
Let's see what the others think, but for now, my suggestion would be something like:
config.setup_blocks << bw_config
NSLog "BW: It seems like you're running an older RubyMotion version than 1.24.
Please run `sudo motion update` to remove this warning."
OK. Whenever you think that anyone will not have to downgrade, you could modify it :)
I will close this request at once.
I'll reopen this one until we get it fixed :)
Currently, the specs are failing with the iOS6 SDK, so I can't get it tested/merged.
Will close it when we get the proper specs.
Is this related to the error I'm getting?
I just update to the latest RubyMotion and BubbleWrap. This happens when I run rake:
undefined local variable or method `configs' for Motion::Project::App:Class
/Users/developer/.rvm/gems/ruby-1.9.3-p194@ios/gems/sugarcube-0.8.2/lib/sugarcube.rb:6:in `<top (required)>'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@ios/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@ios/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in `block in require'
/Users/developer/Source/22Seven/ios/Rakefile:5:in `<top (required)>'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `block in load_rakefile'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:65:in `block in run'
/Users/developer/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
It works fine when change
config.setup_blocks << bw_config
So that is a quickfix for anyone getting this and who still needs to work today :)
@michael-erasmus Thanks for the patch
@mneorr Unfortunately, once you update to RubyMotion 1.24, the specs won't run because of this config vs configs issue (I realize that once that's fixed, there are still other issues preventing the specs from running).
I think we should push this change using the recommendation of Option 2 + a warning.
RubyMotion 1.24 fails to build projects that include BubbleWrap for me.
michael-erasmus's patch fixes it. (thanks!)
Now that I think about it, I think Option 3 is actually better (just don't support < 1.24). If someone has their app locked to an older version in production, they should also have it locked to an older version of BW too. Ideally, RubyMotion would have properly deprecated the configs removal, giving users a period of time to transition and use either one.
Since RubyMotion is still very young and new, and changing all the time, supporting older versions doesn't seem to make a lot of sense. I'd hate to see BW get littered with dozens of conditional statements and/or rescue blocks (for example, @Watson1978's other pull request to add _spec to the end of the test suite name would need a conditional based on the version of RubyMotion being used).
Thoughts? I'd like to get this fixed ASAP so we can push an updated gem; in the mean time, no one can use the current BW gem on RubyMotion 1.24
@dmarkow Agreed on #3. Users should lock to a version/commit.
As more apps go into production, it'll be important too keep branches that work with a particular version of RubyMine/SDK around. Master should really only be for development work I think and should keep moving.
I'll merge this first for that 1.24 is released.
Add checks for minimum supported RubyMotion version (Refer #143)
@dmarkow I've posted another one on #144, the failure reason was different than this one :)
It seems like the iOS5 - 6 transition had some problems with RM compiler.
After updating RM it seems like it's working fine.
bubble-wrap 1.1.4 with this fix is released.