lib/yaml-write-stream/yielding.rb in yaml-write-stream-1.0.0 vs lib/yaml-write-stream/yielding.rb in yaml-write-stream-1.0.1

- old
+ new

@@ -8,16 +8,22 @@ @emitter = emitter @stream = stream @first = true end - def close + def flush # psych gets confused if you open a file and don't at least # pretend to write something write_scalar('') if first emitter.end_document(true) emitter.end_stream + nil + end + + def close + flush stream.close + nil end def write_sequence @first = false