summaryrefslogtreecommitdiff
path: root/ext/psych/lib
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-09 00:54:37 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-09 00:54:37 +0000
commit7c6e4f8f38346a6cddfdae42a58567e668865238 (patch)
treef68e194b16821d563e5d39a1362d3a5c81fc6c27 /ext/psych/lib
parent5c0d17c9a2fbbb60e24cd6bd41ffdf8b63b07318 (diff)
* ext/psych/lib/psych/visitors/to_ruby.rb: anonymous structs
should be able to roundtrip. Thanks @splattael! * test/psych/test_object_references.rb: test for change git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/psych/lib')
-rw-r--r--ext/psych/lib/psych/visitors/to_ruby.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/psych/lib/psych/visitors/to_ruby.rb b/ext/psych/lib/psych/visitors/to_ruby.rb
index 1bfffb952f..42b328a4bf 100644
--- a/ext/psych/lib/psych/visitors/to_ruby.rb
+++ b/ext/psych/lib/psych/visitors/to_ruby.rb
@@ -181,9 +181,11 @@ module Psych
klass = class_loader.struct
members = o.children.map { |c| accept c }
h = Hash[*members]
- klass.new(*h.map { |k,v|
+ s = klass.new(*h.map { |k,v|
class_loader.symbolize k
}).new(*h.map { |k,v| v })
+ register(o, s)
+ s
end
when /^!ruby\/object:?(.*)?$/