The code
require \'yaml\' puts YAML.load(\" is_something: values: [\'yes\', \'no\'] \").to_yaml
produces
--- is_somethin
This ugly hack seems to do the trick...
class Array def to_yaml_style :inline end end
Browsing through ruby's source, I can't find any options I could pass to achieve the same. Default options are described in the lib/yaml/constants.rb.