From: Guillaume Marcais Date: 2004-10-23T07:34:12+09:00 Subject: Re: YAML bug with : in strings? On Fri, 2004-10-22 at 17:19, Joel VanderWerf wrote: > Guillaume Marcais wrote: > > $ irb > > irb(main):001:0> require 'yaml' > > => true > > irb(main):002:0> YAML::load(":not_a_symbol".to_yaml).class > > => Symbol > > > > The original object was a string starting with ':', not a symbol. > > > > Guillaume. > > What version? I get String: I guess I should have given the version in my original post: $ irb -v irb 0.9(02/07/03) $ ruby -v ruby 1.8.1 (2004-04-05) [i686-linux] > > $ ruby -v -r yaml -e 'p YAML::load(":not_a_symbol".to_yaml).class' > ruby 1.9.0 (2004-10-17) [i686-linux] > String Good. It has been fixed. > > The string has been escaped by #to_yaml > > $ ruby -r yaml -e 'puts ":not_a_symbol".to_yaml' > --- ":not_a_symbol" The problem was loading, not emitting: $ ruby -v -ryaml -e 'puts ":not_a_symbol".to_yaml' ruby 1.8.1 (2004-04-05) [i686-linux] --- ":not_a_symbol" $ ruby -v -ryaml -e 'puts YAML::load("--- \":not_a_symbol\"").class' ruby 1.8.1 (2004-04-05) [i686-linux] Symbol Thanks, Guillaume.