lib/yaml-write-stream/stateful.rb in yaml-write-stream-2.0.0 vs lib/yaml-write-stream/stateful.rb in yaml-write-stream-2.0.1
- old
+ new
@@ -165,10 +165,11 @@
def write_sequence(key)
write_scalar(key)
end
def write_key_value(key, value)
- write_scalar(key)
+ quote_key = !!(key =~ /\A\d+\z/)
+ write_scalar(key, quote_key)
write_scalar(value, true)
end
def close
emitter.end_mapping