summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych/visitors/to_ruby.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-15 20:13:21 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-15 20:13:21 +0000
commitb4bdb2f2ebcdd8d77826706470fdeed642b3dee5 (patch)
tree38ef0e7b78fb18f913b9d2cfbd2061cf924cb86c /ext/psych/lib/psych/visitors/to_ruby.rb
parent5341e3ccc4a58ae765e6d78c65bdc33157527aec (diff)
* 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
Diffstat (limited to 'ext/psych/lib/psych/visitors/to_ruby.rb')
-rw-r--r--ext/psych/lib/psych/visitors/to_ruby.rb3
1 files changed, 1 insertions, 2 deletions
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)