From b4bdb2f2ebcdd8d77826706470fdeed642b3dee5 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Tue, 15 May 2012 20:13:21 +0000 Subject: * ext/psych/lib/psych/visitors/to_ruby.rb: fix a bug with string subclass dumping and loading. * test/psych/test_array.rb: pertinent tests * test/psych/test_string.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/psych/lib/psych/visitors/to_ruby.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'ext/psych/lib/psych/visitors/to_ruby.rb') diff --git a/ext/psych/lib/psych/visitors/to_ruby.rb b/ext/psych/lib/psych/visitors/to_ruby.rb index 26da83b8e1..eb4bab7513 100644 --- a/ext/psych/lib/psych/visitors/to_ruby.rb +++ b/ext/psych/lib/psych/visitors/to_ruby.rb @@ -147,8 +147,7 @@ module Psych string = members.delete 'str' if klass - string = klass.allocate - string.replace string + string = klass.allocate.replace string end init_with(string, members.map { |k,v| [k.to_s.sub(/^@/, ''),v] }, o) -- cgit v1.2.3