lib/yaml-write-stream/stateful.rb in yaml-write-stream-1.0.0 vs lib/yaml-write-stream/stateful.rb in yaml-write-stream-1.0.1
- old
+ new
@@ -20,11 +20,11 @@
def after_initialize
@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
until stack.empty?
@@ -35,11 +35,16 @@
end
end
emitter.end_document(true)
emitter.end_stream
- stream.close
@closed = true
+ nil
+ end
+
+ def close
+ flush
+ stream.close
nil
end
def write_map(*args)
check_eos