Sha256: 9efaa938f83dd48aeaf417ecc54438ef3cacdecbd803de3309dcb6da45e56793
Contents?: true
Size: 580 Bytes
Versions: 21
Compression:
Stored size: 580 Bytes
Contents
require 'epitools/minimal' class IO unless IO.respond_to? :copy_stream # # IO.copy_stream backport # def self.copy_stream(input, output) while chunk = input.read(8192) output.write(chunk) end end end # # Iterate over each line of the stream, yielding the line and the byte offset of the start of the line in the file # def each_line_with_offset return to_enum(:each_line_with_offset) unless block_given? offset = 0 each_line do |line| yield line, offset offset += line.bytesize end end end
Version data entries
21 entries across 21 versions & 1 rubygems