-
Notifications
You must be signed in to change notification settings - Fork 30
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
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 ->
.
There was a problem hiding this comment.
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.")
ext/stringio/stringio.c
Outdated
* 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Most welcome! |
ext/stringio/stringio.c
Outdated
* gets(sep = $/, **line_opts) -> string or nil | ||
* gets(limit, **line_opts) -> string or nil | ||
* gets(sep, limit, **line_opts) -> string or nil |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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]. |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
(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
(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
Treats: