[MacRuby] #1266: NameError: `@_save_parents:_sentinel' is not allowed as an instance variable name
#1266: NameError: `@_save_parents:_sentinel' is not allowed as an instance variable name ------------------------------+--------------------------------------------- Reporter: jhamor@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ------------------------------+--------------------------------------------- Datamapper seems to be broken when creating resources, regardless of adapter. {{{ irb(main):001:0> require 'stringio' => true irb(main):002:0> require 'rubygems' => true irb(main):003:0> require 'dm-core' => true irb(main):004:0> => nil irb(main):005:0> class User irb(main):006:1> include DataMapper::Resource irb(main):007:1> property :login, String, :key => true irb(main):008:0> end => #<DataMapper::Property::String @model=User @name=:login> irb(main):009:0> User.create(:login => "jhamor") NameError: `@_save_parents:_sentinel' is not allowed as an instance variable name /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems /dm-core-1.0.2/lib/dm-core/resource.rb:1230:in `run_once:' /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems /dm-core-1.0.2/lib/dm-core/resource.rb:1047:in `save_parents:' /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems /dm-core-1.0.2/lib/dm-core/resource.rb:1018:in `block' /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems /dm-core-1.0.2/lib/dm-core/resource.rb:1234:in `run_once:' /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems /dm-core-1.0.2/lib/dm-core/resource.rb:1017:in `_save' /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems /dm-core-1.0.2/lib/dm-core/resource.rb:417:in `save' }}} Marked as a blocker primarily because this limits me from using macruby as a whole for my project. -- Ticket URL: <http://www.macruby.org/trac/ticket/1266> MacRuby <http://macruby.org/>
#1266: NameError: `@_save_parents:_sentinel' is not allowed as an instance variable name ------------------------------+--------------------------------------------- Reporter: jhamor@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ------------------------------+--------------------------------------------- Comment(by lsansonetti@…): Clearly `@_save_parents:_sentinel' isn't a valid name for an ivar. I assume it's being generated dynamically, a reduction would be helpful. -- Ticket URL: <http://www.macruby.org/trac/ticket/1266#comment:1> MacRuby <http://macruby.org/>
#1266: NameError: `@_save_parents:_sentinel' is not allowed as an instance variable name ------------------------------+--------------------------------------------- Reporter: jhamor@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ------------------------------+--------------------------------------------- Comment(by lsansonetti@…): {{{ def run_once(default) caller_method = Kernel.caller(1).first[/`([^'?!]+)[?!]?'/, 1] sentinel = "@_#{caller_method}_sentinel" return instance_variable_get(sentinel) if instance_variable_defined?(sentinel) }}} I suspect that here #caller returns selectors with the trailing ':' character. -- Ticket URL: <http://www.macruby.org/trac/ticket/1266#comment:2> MacRuby <http://macruby.org/>
#1266: NameError: `@_save_parents:_sentinel' is not allowed as an instance variable name ------------------------------+--------------------------------------------- Reporter: jhamor@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.11 Component: MacRuby | Resolution: fixed Keywords: | ------------------------------+--------------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.11 Comment: The problem should be fixed in https://github.com/MacRuby/MacRuby/commit/d94e20e9d5111c3f17deb92a4b4c8d5cc9... -- Ticket URL: <http://www.macruby.org/trac/ticket/1266#comment:3> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby