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] More about line number #6582

Merged
merged 2 commits into from
Oct 19, 2022
Merged

[DOC] More about line number #6582

merged 2 commits into from
Oct 19, 2022

Conversation

BurdetteLamar
Copy link
Member

Adds info about when line number changes; also suppresses a few unwanted autolinks in file.c.

@BurdetteLamar BurdetteLamar added the Documentation Improvements to documentation. label Oct 18, 2022
Comment on lines 367 to 372
The line number is the number of lines read by certain line-oriented methods
(+each_line+, +foreach+, +gets+, +readline+, and +readlines+),
not the number of newlines read; the two numbers:

- Will be the same if those methods are called only with the default line separator.
- May differ if any is called with a non-default line separator.
Copy link
Member

Choose a reason for hiding this comment

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

I feel like this is a bit redundant. The line number is the number of linebreaks encountered however you define a newline, which could be \n, \r\n, or something else.

Copy link
Member Author

Choose a reason for hiding this comment

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

Recast. B/c we now mention argument +sep+, I've linked to the methods.

Comment on lines 374 to 375
A new stream is initially has line number zero,
and method +rewind+ resets the line number to zero.
Copy link
Member

Choose a reason for hiding this comment

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

This makes it sound like all rewind does is reset the lineno (when in reality, resetting the lineno is more of a side effect of rewind).

Copy link
Member Author

Choose a reason for hiding this comment

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

Recast.

@BurdetteLamar BurdetteLamar merged commit bc939d2 into ruby:master Oct 19, 2022
tenderlove pushed a commit to Shopify/ruby that referenced this pull request Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements to documentation.
2 participants