From: Florian Gross Date: 2004-03-15T04:44:34+09:00 Subject: Re: YAML questions Hal Fulton wrote: > First of all, are there guidelines somewhere for writing YAML > manually? I can't figure out how to put hashes/arrays in a > single line instead of multiple lines. (I got the idea this was > possible somehow.) irb(main):017:0> YAML.load("---\n [1, 2, 3]") => [1, 2, 3] irb(main):018:0> YAML.load("---\n {1: 2, 3: 4}") => {1=>2, 3=>4} > obj = YAML.load_file("filename") That looks very nice and I would find it nice, too. (I've been using YAML.load(File.read(filename)) for this which isn't all that comfortable...) Oh, and here's something I find quite confusing about yaml.rb: It's possible to do YAML.load("- foo"), but YAML.load("[foo]") produces a parse error. (YAML.load("---\n[foo]") also works.) Regards, Florian Gross