lib/io_streams/line/reader.rb in iostreams-0.19.0 vs lib/io_streams/line/reader.rb in iostreams-0.20.0
- old
+ new
@@ -55,13 +55,14 @@
@line_number = 0
@eof = false
@read_cache_buffer = nil
@buffer = nil
+ @delimiter = delimiter
read_block
# Auto-detect windows/linux line endings if not supplied. \n or \r\n
- @delimiter = delimiter || auto_detect_line_endings
+ @delimiter ||= auto_detect_line_endings
if @buffer
# Change the delimiters encoding to match that of the input stream
@delimiter = @delimiter.encode(@buffer.encoding)
@delimiter_size = @delimiter.size