From 7c6e4f8f38346a6cddfdae42a58567e668865238 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Thu, 9 Jan 2014 00:54:37 +0000 Subject: * 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 --- ext/psych/lib/psych/visitors/to_ruby.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ext/psych/lib') 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:?(.*)?$/ -- cgit v1.2.3