Repository navigation
Add RemoteInput#each_line - #39
Merged
Merged
Conversation
GitHub: red-data-toolsGH-5 It's like `IO#each_line`. It passes all arguments and the block to `IO#each_line`. It also returns the same value as `IO#each_line` does: * With a block: returns `self`, not the internal `File` * Without a block: returns an `Enumerator` We need this to read a `RemoteInput` line by line, because Red Datasets reads some text data with `IO#each_line`: ```ruby RemoteInput.open("https://example.com/data.txt") do |input| input.each_line(chomp: true) do |line| # ... end end ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub: GH-5
It's like
IO#each_line. It passes all arguments and the block toIO#each_line.It also returns the same value as
IO#each_linedoes:self, not the internalFileEnumeratorWe need this to read a
RemoteInputline by line, because Red Datasets reads some text data withIO#each_line: