lib/io_streams/line/writer.rb in iostreams-1.0.0.beta vs lib/io_streams/line/writer.rb in iostreams-1.0.0.beta2
- old
+ new
@@ -2,13 +2,13 @@
module Line
class Writer < IOStreams::Writer
attr_reader :delimiter
# Write a line at a time to a stream.
- def self.stream(output_stream, original_file_name: nil, **args, &block)
+ def self.stream(output_stream, **args)
# Pass-through if already a line writer
- return block.call(output_stream) if output_stream.is_a?(self.class)
+ return yield(output_stream) if output_stream.is_a?(self.class)
yield new(output_stream, **args)
end
# A delimited stream writer that will write to the supplied output stream.
@@ -22,10 +22,10 @@
#
# delimiter: [String]
# Add the specified delimiter after every record when writing it
# to the output stream
# Default: OS Specific. Linux: "\n"
- def initialize(output_stream, delimiter: $/)
+ def initialize(output_stream, delimiter: $/, original_file_name: nil)
super(output_stream)
@delimiter = delimiter
end
# Write a line to the output stream