I stumbled across what is a bug in the YAML library. It does not
properly encode certain multi-line strings. Fire up irb, and try the
s3 = “\n Do I work?\nNo indent”
=> “\n Do I work?\nNo indent”
ArgumentError: syntax error on line 3, col 0:
No indent' from /opt/ruby-enterprise-1.8.6-20080810/lib/ruby/1.8/yaml.rb:133:inload’
I’ve confirmed it’s broken in both 1.8.6.p111, and REE 1.8.6.p287.
I wrote up a pretty thorough exploration of this bug in a blog post
describing the problem and offering a (sub-optimal) patch:
Is this the right list to discuss this?