From: Daniel Sheppard Date: 2005-10-26T10:55:14+09:00 Subject: Bug with Nils in YAML I can't find much reference to this anywhere, except a discussion on ruby-core that I wasn't sure was related. The version of YAML that I've got can't handle this: YAML::load({nil=>'x'}.to_yaml) ArgumentError: parse error on line 1, col 1: `: x' from e:/Development/Ruby/lib/ruby/1.8/yaml.rb:119:in `load' from e:/Development/Ruby/lib/ruby/1.8/yaml.rb:119:in `load' from (irb):5 also: p YAML::load("--- \n~").to_yaml => "--- " > ruby -v ruby 1.8.2 (2004-12-25) [i386-mswin32] The source code for my NilClass#to_yaml differs from that displayed at ruby-doc, so maybe the newer version fixes it, this seems to do it: class NilClass def to_yaml( opts = {} ) opts[:KeepValue] = true "~".to_yaml( opts ) end end ##################################################################################### This email has been scanned by MailMarshal, an email content filter. #####################################################################################