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
More on IO doc #9842
More on IO doc #9842
Conversation
* - IO#readlines: Returns all remaining lines in an array. | ||
* === Line Input | ||
* | ||
* \Class \IO supports line-oriented input for |
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.
At Auto-Linking:
If not, or if you suppress autolinking, consider forcing monofont.
* \Class \IO supports line-oriented input for | |
* \Class +IO+ supports line-oriented input for |
"Class" is "the word in question does not refer to a Ruby entity", so it should be rendered as a normal text.
But "IO" is "the reference is to the current class document", it should be rendered as code, I think.
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.
@nobu, point taken. There are many of these in this class overview. Most should be changed as you've indicated; some may be better rendered as I/O
. If okay with you, I'd like to handle in the next PR instead of complicating matters here.
io.c
Outdated
* p f.gets | ||
* p f.gets | ||
* p f.gets |
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 this is more consistent with the rest of the docs:
* p f.gets | |
* p f.gets | |
* p f.gets | |
* f.gets # => "First l" | |
* f.gets # => "ine\nSecond l" | |
* f.gets # => "ine\n\nFourth l" |
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 (and "Output" below removed).
* Each of the {line input methods}[rdoc-ref:IO@Line+Input] | ||
* accepts two special values for parameter +sep+: | ||
* | ||
* - +nil+: The entire stream is to be read ("slurped") into a single string: |
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.
Nit: why are we calling it "slurp"? It doesn't seem like a term used anywhere in the docs.
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.
The term is well established in other interpreted languages (Perl and Python in particular), where its meaning is "read it all."
@peterzhu2118, if you approve this, please don't merge it; I can then go ahead and take care of the comment from @nobu (re \IO). |
@peterzhu2118, can we go ahead and get this merged? |
Improve documentation for line-oriented IO (which I suspect is of greatest interest to many users).