You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works with syck, but doesn't work with psych:
irb(main):013:0> s = <<EOF
irb(main):014:0" foo: &foo
irb(main):015:0" bar: 10
irb(main):016:0" product:
irb(main):017:0" !ruby/object:Product
irb(main):018:0" <<: *foo
irb(main):019:0" EOF
=> "foo: &foo\n bar: 10\nproduct:\n !ruby/object:Product\n <<: *foo\n"
irb(main):020:0> Product = Class.new
=> Product
irb(main):021:0> YAML.load(s)
NameError: `@<<' is not allowed as an instance variable name
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:321:in `instance_variable_set'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:321:in `block in init_with'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:321:in `each'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:321:in `init_with'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:306:in `revive'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:178:in `visit_Psych_Nodes_Mapping'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/visitor.rb:15:in `visit'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/visitor.rb:5:in `accept'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:20:in `accept'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:268:in `block in revive_hash'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:266:in `each'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:266:in `each_slice'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:266:in `revive_hash'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:141:in `visit_Psych_Nodes_Mapping'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/visitor.rb:15:in `visit'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/visitor.rb:5:in `accept'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:20:in `accept'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:240:in `visit_Psych_Nodes_Document'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/visitor.rb:15:in `visit'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/visitor.rb:5:in `accept'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:20:in `accept'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych/nodes/node.rb:35:in `to_ruby'
from /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/psych.rb:130:in `load'
from (irb):21
from /usr/local/bin/irb:12:in `<main>'irb(main):022:0>
The text was updated successfully, but these errors were encountered:
This works with syck, but doesn't work with psych:
The text was updated successfully, but these errors were encountered: