環境: ruby1.9.3 , psych(任意のバージョン) ex:
o = { 'hash' => { 'name' => 'Steve', 'foo' => 'bar' } }
=> {"hash"=>{"name"=>"Steve", "foo"=>"bar"}}
#is there a inline option?
puts Psych.dump(o,{:inline =>true})
実際の結果:
---
hash:
name: Steve
foo: bar
出力を期待します:
---
hash: { name: Steve, foo: bar }