From: Simon Chiang Date: 2009-04-10T23:41:55+09:00 Subject: Re: Emit YAML without leading hyphens? > perfectly valid yaml (ruby yaml loads it happily) - i simply dont > understand why those hyphens are created, when the yaml file _without_ > hyphens works perfectly nice. One reason for the hyphens is to allow multiple YAML documents (ie separate objects) to be stored in a single file: docs = [1,2,3].to_yaml + [4,5,6].to_yaml results = [] YAML.load_documents(docs) do |doc| results << doc end puts results.inspect # => "[[1,2,3], [4,5,6]]" Notice each of the arrays is loaded separately. As for removing the header, take a look at this post: http://www.arkanis-development.de/weblog/2007/6/20/options-for-rubys-@to_yaml@-method The author was facing the same problem. The option is {:UseHeader => false} but the to_yaml options aren't currently used and don't work, even though at some point they probably did. It's a deficiency in the current release.