Skip to content

Instantly share code, notes, and snippets.

@todb-r7
Created April 15, 2012 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todb-r7/2394895 to your computer and use it in GitHub Desktop.
Save todb-r7/2394895 to your computer and use it in GitHub Desktop.
Ruby 1.9.3 standard YAML makes me a sad panda
1.9.3p125 :004 > YAML::VERSION
=> "1.2.2"
1.9.3p125 :005 > a = "foo"
=> "foo"
1.9.3p125 :007 > a.force_encoding("BINARY")
=> "foo"
1.9.3p125 :008 > a.encoding
=> #<Encoding:ASCII-8BIT>
1.9.3p125 :009 > YAML.dump(a)
=> "--- !binary |-\n Zm9v\n"
1.9.3p125 :010 > exit
mazikeen:./.msf4$ rvm use default
Using /home/todb/.rvm/gems/ruby-1.9.1-p378
mazikeen:./.msf4$ irb
1.9.1p378 :002 > require 'yaml'
=> true
1.9.1p378 :003 > a = "foo"
=> "foo"
1.9.1p378 :004 > a.force_encoding("BINARY")
=> "foo"
1.9.1p378 :005 > a.encoding
=> #<Encoding:ASCII-8BIT>
1.9.1p378 :006 > YAML.dump(a)
=> "--- foo\n"
1.9.1p378 :007 > exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment