Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Dumping a simple String subclass fails #166

Closed
msievers opened this Issue Oct 29, 2013 · 0 comments

Comments

1 participant

When I dump/load a simple subclass of String I get an incorrect value. This can be reproduced with irb.

2.0.0-p247 :001 > require 'psych'
 => true
2.0.0-p247 :002 > class X < String
2.0.0-p247 :003?> end
 => nil
2.0.0-p247 :004 > Psych.load Psych.dump X.new('foo')
 => "Zm9v"   (should be "foo")

The dumped YAML looks like this

2.0.0-p247 :005 > Psych.dump X.new('foo')
 => "--- !ruby/string:X |-\n  Zm9v\n"

Psych::VERSION is 2.0.0

headius pushed a commit to jruby/ruby that referenced this issue Oct 30, 2013

* ext/psych/lib/psych/visitors/yaml_tree.rb: string subclasses should
  not be considered to be binary.  Fixes Psych / GH 166
  ruby/psych#166

* test/psych/test_string.rb: test for fix

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

vbatts added a commit to vbatts/ruby that referenced this issue Nov 4, 2013

* ext/psych/lib/psych/visitors/yaml_tree.rb: string subclasses should
  not be considered to be binary.  Fixes Psych / GH 166
  ruby/psych#166

* test/psych/test_string.rb: test for fix

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

tenderlove added a commit to tenderlove/ruby that referenced this issue Jan 24, 2014

* ext/psych/lib/psych/visitors/yaml_tree.rb: string subclasses should
  not be considered to be binary.  Fixes Psych / GH 166
  ruby/psych#166

* test/psych/test_string.rb: test for fix

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

cjcolvar added a commit to avalonmediasystem/avalon-installer that referenced this issue Apr 4, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment