lib/io_streams/line/writer.rb in iostreams-1.0.0.beta7 vs lib/io_streams/line/writer.rb in iostreams-1.0.0
- old
+ new
@@ -30,11 +30,11 @@
end
# Write a line to the output stream
#
# Example:
- # IOStreams.line_writer('a.txt') do |stream|
+ # IOStreams.path('a.txt').writer(:line) do |stream|
# stream << 'first line' << 'second line'
# end
def <<(data)
write(data)
self
@@ -42,10 +42,10 @@
# Write a line to the output stream followed by the delimiter.
# Returns [Integer] the number of bytes written.
#
# Example:
- # IOStreams.line_writer('a.txt') do |stream|
+ # IOStreams.path('a.txt').writer(:line) do |stream|
# count = stream.write('first line')
# puts "Wrote #{count} bytes to the output file, including the delimiter"
# end
def write(data)
output_stream.write(data.to_s + delimiter)