diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-05-15 13:14:04 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-05-15 13:14:04 -0700 |
commit | 620fc6d749f0e94f7b433af9419927039ca1bfa4 (patch) | |
tree | cc94511ba5b51752ad3806ae77d81c07e960f911 /lib | |
parent | 5be67a387507958aa2e7c5b35035bd1941c0ac1b (diff) | |
download | psych-620fc6d749f0e94f7b433af9419927039ca1bfa4.zip |
* 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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/psych/visitors/to_ruby.rb | 3 |
1 files changed, 1 insertions, 2 deletions
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) |