Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOC] Enhanced RDoc for StringIO #36

Merged
merged 3 commits into from Oct 21, 2022
Merged

[DOC] Enhanced RDoc for StringIO #36

merged 3 commits into from Oct 21, 2022

Conversation

BurdetteLamar
Copy link
Member

Treats:

  • #each_codepoint
  • #gets
  • #readline (shows up in doc for module IO::generic_readable, not class StringIO)
  • #each_line

Copy link
Contributor

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

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

Thanks for polishing the docs!

(I looked at a minor detail and wrote that.)

@@ -1153,10 +1153,12 @@ strio_each_char(VALUE self)

/*
* call-seq:
* strio.each_codepoint {|c| block } -> strio
* strio.each_codepoint -> anEnumerator
* each_codepoint {|codepoint| ... } -> self
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: Here, the arrow is ->.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed. (When copying from HTML, I sometimes get burned by this, and by "smart quotes.")

* strio.gets(sep=$/, chomp: false) -> string or nil
* strio.gets(limit, chomp: false) -> string or nil
* strio.gets(sep, limit, chomp: false) -> string or nil
* gets(sep = $/, **line_opts) → string or nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: Here, and in the rest of the change, the arrow is a ligature.

I don't know which is preferred/correct.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@BurdetteLamar
Copy link
Member Author

Thanks for polishing the docs!

Most welcome!

Comment on lines 1371 to 1373
* gets(sep = $/, **line_opts) -> string or nil
* gets(limit, **line_opts) -> string or nil
* gets(sep, limit, **line_opts) -> string or nil
Copy link
Member

Choose a reason for hiding this comment

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

It looks like the only keyword argument that these method accept is chomp:, so I think it's clearer to explicitly state that rather than having a generic **line_opts.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed (9 places).

* Calls the block with each remaining line read from the stream;
* does nothing if already at end-of-file;
* returns +self+.
* See {Line IO}[https://docs.ruby-lang.org/en/master/io_streams_rdoc.html#label-Line+IO].
Copy link
Member

Choose a reason for hiding this comment

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

I think we should mention that each is an alias of each_line.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added.

Copy link
Member

@peterzhu2118 peterzhu2118 left a comment

Choose a reason for hiding this comment

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

Looks good!

@BurdetteLamar BurdetteLamar merged commit 659aca7 into ruby:master Oct 21, 2022
matzbot pushed a commit to ruby/ruby that referenced this pull request Oct 21, 2022
(ruby/stringio#36)

Treats:
- #each_codepoint
- #gets
- #readline (shows up in doc for module IO::generic_readable, not class
StringIO)
- #each_line

ruby/stringio@659aca7fe5
tenderlove pushed a commit to Shopify/ruby that referenced this pull request Oct 27, 2022
(ruby/stringio#36)

Treats:
- #each_codepoint
- #gets
- #readline (shows up in doc for module IO::generic_readable, not class
StringIO)
- #each_line

ruby/stringio@659aca7fe5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants