From 620fc6d749f0e94f7b433af9419927039ca1bfa4 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 15 May 2012 13:14:04 -0700 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 --- lib/psych/visitors/to_ruby.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/psych/visitors/to_ruby.rb b/lib/psych/visitors/to_ruby.rb index 26da83b..eb4bab7 100644 --- a/lib/psych/visitors/to_ruby.rb +++ b/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