Skip to content

Releases: jdlubrano/stream_lines

v0.4.1

18 Apr 16:17
Compare
Choose a tag to compare
  • Fixes surprising behavior when using Enumerable#first with StreamLines::Reading::CSVs. See Issue #127 and PR #128 .

v0.4.0

19 Jul 18:40
Compare
Choose a tag to compare

Adds support for encoding and handle invalid byte sequences #44

I am hoping that this is not a breaking change since the default encoding is used by default; however, I am not an expert on encodings. Thus I could have introduced something encoding-related that has unforeseen and undesirable consequences.

v0.3.1

04 Mar 21:43
Compare
Choose a tag to compare
  • Fixes bug with null bytes within streams (#26)

I was seeing rather inexplicable behavior in a production application where null bytes were being added to the beginning of streamed lines. I was able to debug and observe that the StringIO buffer would accumulate \u0000 bytes, but I have no idea why. In any case, initializing a new StringIO instead of truncating seems to fix the issue.

v0.3.0

14 Feb 15:30
Compare
Choose a tag to compare
url = 'https://my.remote.file/file.jsonl'
stream = StreamLines::Reading::JSONLines.new(url)

stream.each do |row|
  # each row will be an Hash
end

# Supports all Ruby JSON::parse options
stream = StreamLines::Reading::JSONLines.new(url, symbolize_names: true)

stream.each do |row|
  # each row will be a Hash
end

v0.2.1

13 Feb 22:00
Compare
Choose a tag to compare

Ensures that StreamLines::Reading::CSV is available when you require 'stream_lines'

v0.2.0

13 Feb 15:36
Compare
Choose a tag to compare

Provides first-class support for streaming CSVs from a remote URL (#16).

url = 'https://my.remote.file/file.csv'
stream = StreamLines::Reading::CSV.new(url)

stream.each do |row|
  # each row will be an array
end

# Supports most Ruby CSV options (see ignored options below)
stream = StreamLines::Reading::CSV.new(url, headers: true)

stream.each do |row|
  # each row is a CSV::Row object that you can access like row['column_name']
end

Most options that you can pass to Ruby's CSV library are supported; however, the following options are explicitly ignored:

  • return_headers
  • header_converters
  • skip_lines

I suspect that these options are not used terribly frequently, and each would require additional logic in the StreamLines::Reading::CSV#each method. Rather than attempting to implement sensible solutions for these options, I am choosing to explicitly ignore them until there is enough outcry to support them.