ruby / psych

A libyaml wrapper for Ruby
MIT License
564 stars 203 forks source link

: or space at the end of a string causes Psych.dump to act as dump_stream? #152

Closed renemadsen closed 11 years ago

renemadsen commented 11 years ago

When having a string like

k = "dgdg dg dgd :"

Psych.dump(k) "--- ! 'dgdg dg dgd :'\n"

Where it should have looked like "--- dgdg dg dgd :\n...\n"


l = "dgdg dg dgd "

Psych.dump(l) "--- ! 'dgdg dg dgd '\n"

Where it should have looked like "--- dgdg dg dgd \n...\n"

Why does it not do this?

renemadsen commented 11 years ago

I guess it's something like this http://pyyaml.org/wiki/YAMLColonInFlowContext that is causing the "problem"?

tenderlove commented 11 years ago

The ! are removed in the latest version, but the quotes need to remain as the space character and the colon character would cause an ambiguity (your YAML would not round trip).