Menu

#6 nil emited as an empty string

open
nobody
None
5
2004-01-21
2004-01-21
Anonymous
No

nil is emited as an empty string. This produces
incorrect YAML output.

So YAML::load({nil=>nil}.to_yaml) fails.

Proposed change in yaml/rubytypes.rb:

class NilClass
def is_complex_yaml?
false
end
def to_yaml( opts = {} )
opts[:KeepValue] = true
"~".to_yaml( opts ) # "~" instead of ""
end
end

Discussion


Log in to post a comment.

Monday.com Logo