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] Fix links in doc #9970

Merged
merged 4 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions file.c
Original file line number Diff line number Diff line change
Expand Up @@ -7665,11 +7665,13 @@ Init_File(void)
*
* Flag File::BINARY specifies that the stream is to be accessed in binary mode.
*
* ==== File::SHARE_DELETE (Windows Only)
* ==== File::SHARE_DELETE
*
* Flag File::SHARE_DELETE enables other processes to open the stream
* with delete access.
*
* Windows only.
*
* If the stream is opened for (local) delete access without File::SHARE_DELETE,
* and another process attempts to open it with delete access,
* the attempt fails and the stream is not opened for that process.
Expand Down Expand Up @@ -7744,9 +7746,11 @@ Init_File(void)
* do not match the directory separator
* (the value of constant File::SEPARATOR).
*
* ==== File::FNM_SHORTNAME (Windows Only)
* ==== File::FNM_SHORTNAME
*
* Flag File::FNM_SHORTNAME allows patterns to match short names if they exist.
*
* Flag File::FNM_SHORTNAME Allows patterns to match short names if they exist.
* Windows only.
*
* ==== File::FNM_SYSCASE
*
Expand Down Expand Up @@ -7799,7 +7803,7 @@ Init_File(void)
#ifndef O_SHARE_DELETE
# define O_SHARE_DELETE 0
#endif
/* {File::SHARE_DELETE}[rdoc-ref:File::Constants@File-3A-3ASHARE_DELETE+-28Windows+Only-29] */
/* {File::SHARE_DELETE}[rdoc-ref:File::Constants@File-3A-3ASHARE_DELETE] */
rb_define_const(rb_mFConst, "SHARE_DELETE", INT2FIX(O_SHARE_DELETE));
#ifdef O_SYNC
/* {File::SYNC}[rdoc-ref:File::Constants@File-3A-3ASYNC-2C+File-3A-3ARSYNC-2C+and+File-3A-3ADSYNC] */
Expand Down
57 changes: 31 additions & 26 deletions io.c
Original file line number Diff line number Diff line change
Expand Up @@ -4302,11 +4302,8 @@ rb_io_gets_internal(VALUE io)
* File.open('t.txt') {|f| f.gets(12) } # => "First line\n"
*
* With arguments +sep+ and +limit+ given,
* combines the two behaviors:
*
* - Returns the next line as determined by line separator +sep+,
* or +nil+ if none.
* - But returns no more bytes than are allowed by the limit.
* combines the two behaviors
* (see {Line Separator and Line Limit}[rdoc-ref:IO@Line+Separator+and+Line+Limit]).
*
* Optional keyword argument +chomp+ specifies whether line separators
* are to be omitted:
Expand Down Expand Up @@ -4455,10 +4452,8 @@ static VALUE io_readlines(const struct getline_arg *arg, VALUE io);
* f.close
*
* With arguments +sep+ and +limit+ given,
* combines the two behaviors:
*
* - Returns lines as determined by line separator +sep+.
* - But returns no more bytes in a line than are allowed by the limit.
* combines the two behaviors
* (see {Line Separator and Line Limit}[rdoc-ref:IO@Line+Separator+and+Line+Limit]).
*
* Optional keyword argument +chomp+ specifies whether line separators
* are to be omitted:
Expand Down Expand Up @@ -4578,10 +4573,8 @@ io_readlines(const struct getline_arg *arg, VALUE io)
* "ne\n"
*
* With arguments +sep+ and +limit+ given,
* combines the two behaviors:
*
* - Calls with the next line as determined by line separator +sep+.
* - But returns no more bytes than are allowed by the limit.
* combines the two behaviors
* (see {Line Separator and Line Limit}[rdoc-ref:IO@Line+Separator+and+Line+Limit]).
*
* Optional keyword argument +chomp+ specifies whether line separators
* are to be omitted:
Expand Down Expand Up @@ -10473,8 +10466,9 @@ static VALUE argf_readlines(int, VALUE *, VALUE);
* $cat t.txt | ruby -e "p readlines 12"
* ["First line\n", "Second line\n", "\n", "Fourth line\n", "Fifth line\n"]
*
* With arguments +sep+ and +limit+ given, combines the two behaviors;
* see {Line Separator and Line Limit}[rdoc-ref:IO@Line+Separator+and+Line+Limit].
peterzhu2118 marked this conversation as resolved.
Show resolved Hide resolved
* With arguments +sep+ and +limit+ given,
* combines the two behaviors
* (see {Line Separator and Line Limit}[rdoc-ref:IO@Line+Separator+and+Line+Limit]).
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this link exists.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have to figure this out. I have that section in io.c on my branch links_repair; the file is not showing as modified or staged, and committing and/or pushing does nothing.

Copy link
Member Author

Choose a reason for hiding this comment

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

I see the section in https://github.com/ruby/ruby/blob/2f29d42f1c7eb2a9294b9c818745d78b0b18da13/io.c, line 15221. On my machine, RDoc builds valid links to this heading. Link does not exist or does not work for you?

Copy link
Member

Choose a reason for hiding this comment

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

Ah I see you added it back in 2f29d42.

*
* Optional keyword argument +chomp+ specifies whether line separators
* are to be omitted:
Expand Down Expand Up @@ -11985,7 +11979,7 @@ io_s_foreach(VALUE v)
*
* With argument +limit+ given, parses lines as determined by the default
* line separator and the given line-length limit
* (see {Line Limit}[rdoc-ref:IO@Line+Limit]):
* (see {Line Separator}[rdoc-ref:IO@Line+Separator] and {Line Limit}[rdoc-ref:IO@Line+Limit]):
*
* File.foreach('t.txt', 7) {|line| p line }
*
Expand All @@ -12001,10 +11995,9 @@ io_s_foreach(VALUE v)
* "Fourth l"
* "line\n"
*
* With arguments +sep+ and +limit+ given,
* parses lines as determined by the given
* line separator and the given line-length limit
* (see {Line Separator and Line Limit}[rdoc-ref:IO@Line+Separator+and+Line+Limit]):
* With arguments +sep+ and +limit+ given,
* combines the two behaviors
* (see {Line Separator and Line Limit}[rdoc-ref:IO@Line+Separator+and+Line+Limit]).
*
* Optional keyword arguments +opts+ specify:
*
Expand Down Expand Up @@ -12077,15 +12070,14 @@ io_s_readlines(VALUE v)
*
* With argument +limit+ given, parses lines as determined by the default
* line separator and the given line-length limit
* (see {Line Limit}[rdoc-ref:IO@Line+Limit]):
* (see {Line Separator}[rdoc-ref:IO@Line+Separator] and {Line Limit}[rdoc-ref:IO@Line+Limit]:
*
* IO.readlines('t.txt', 7)
* # => ["First l", "ine\n", "Second ", "line\n", "\n", "Third l", "ine\n", "Fourth ", "line\n"]
*
* With arguments +sep+ and +limit+ given,
* parses lines as determined by the given
* line separator and the given line-length limit
* (see {Line Separator and Line Limit}[rdoc-ref:IO@Line+Separator+and+Line+Limit]):
* With arguments +sep+ and +limit+ given,
* combines the two behaviors
* (see {Line Separator and Line Limit}[rdoc-ref:IO@Line+Separator+and+Line+Limit]).
*
* Optional keyword arguments +opts+ specify:
*
Expand Down Expand Up @@ -14866,7 +14858,8 @@ set_LAST_READ_LINE(VALUE val, ID _x, VALUE *_y)
* ["ARGF.read", "Open the pod bay doors, Hal.\n"]
*
* When no character <tt>'-'</tt> is given, stream <tt>$stdin</tt> is ignored
* (exception: see {Special Case}[rdoc-ref:ARGF@Special+Case]):
* (exception:
* see {Specifying $stdin in ARGV}[rdoc-ref:ARGF@Specifying+-24stdin+in+ARGV]):
*
* - Command and output:
*
Expand Down Expand Up @@ -15225,6 +15218,18 @@ set_LAST_READ_LINE(VALUE val, ID _x, VALUE *_y)
* File.open('t.rus') {|f| f.gets(3).size } # => 2
* File.open('t.rus') {|f| f.gets(4).size } # => 2
*
* ===== Line Separator and Line Limit
*
* With arguments +sep+ and +limit+ given, combines the two behaviors:
*
* - Returns the next line as determined by line separator +sep+.
* - But returns no more bytes than are allowed by the limit +limit+.
*
* Example:
*
* File.open('t.txt') {|f| f.gets('li', 20) } # => "First li"
* File.open('t.txt') {|f| f.gets('li', 2) } # => "Fi"
*
* ===== Line Number
*
* A readable \IO stream has a non-negative integer <i>line number</i>:
Expand Down