Skip to content

Rdoc#137

Merged
BurdetteLamar merged 3 commits intoruby:masterfrom
BurdetteLamar:rdoc
Jun 13, 2020
Merged

Rdoc#137
BurdetteLamar merged 3 commits intoruby:masterfrom
BurdetteLamar:rdoc

Conversation

@BurdetteLamar
Copy link
Member

Enhancements for open, parse, minor tweaks.

@BurdetteLamar BurdetteLamar merged commit 35392f4 into ruby:master Jun 13, 2020
@BurdetteLamar BurdetteLamar requested a review from kou June 13, 2020 18:28
@BurdetteLamar
Copy link
Member Author

@kou, did not mean to merge this. What to do now?

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just fix problems by additional commits. :-)

#
# Read rows from an \IO object:
# CSV.foreach(io) {|row| p row } # => 21
# CSV.foreach(File.open(path)) {|row| p row } # => 21
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not use no close File.open in example. It's a bad mannar:

File.open(path) do |input|
  CSV.foreach(io) {row p row } # => 21
end

# open( filename, **options )
# open(file_path, mode = "rb", **options ) -> new_csv
# open(io, mode = "rb", **options ) -> new_csv
# open(file_path, mode = "rb", **options ) { |csv| ... } -> new_csv
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It returns the block's return value not the yielded csv instance.

@BurdetteLamar
Copy link
Member Author

Ok, thanks. Will study tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants