Skip to content

[DOC] Enhancements for globals.md#15545

Merged
BurdetteLamar merged 6 commits intoruby:masterfrom
BurdetteLamar:globals_doc
Dec 20, 2025
Merged

[DOC] Enhancements for globals.md#15545
BurdetteLamar merged 6 commits intoruby:masterfrom
BurdetteLamar:globals_doc

Conversation

@BurdetteLamar
Copy link
Member

Replacement for #15389.

@BurdetteLamar BurdetteLamar requested a review from nobu December 14, 2025 16:51
@BurdetteLamar BurdetteLamar added the Documentation Improvements to documentation. label Dec 14, 2025
@nobu
Copy link
Member

nobu commented Dec 17, 2025

Don't the tables in the "In Brief" section overlap with those in the "Summary" section?

@BurdetteLamar
Copy link
Member Author

Don't the tables in the "In Brief" section overlap with those in the "Summary" section?

Yes, and there are other (major) repetitions. Marking as draft while I study and fix.

@BurdetteLamar BurdetteLamar marked this pull request as draft December 17, 2025 17:52

| Variable | \English | Initially | Read-Only | Set By |
|:------------:|:--------:|:---------------------------------------------:|:---------:|---------|
| `$FILENAME` | | The value returned by method `ARGF#filename`. | Yes. | `ARGF` |
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
| `$FILENAME` | | The value returned by method `ARGF#filename`. | Yes. | `ARGF` |
| `$FILENAME` | | The value returned by method `ARGF.filename`. | Yes. | `ARGF` |

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.

Comment on lines +401 to +402
Initially `true` if command-line option `-d` or `--debug` is given,
otherwise initially `false`;
Copy link
Member

Choose a reason for hiding this comment

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

Duplicate with the next sentence.

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.

Comment on lines +413 to +414
Initially `true` if command-line option `-v` or `-w` is given,
otherwise initially `false`;
Copy link
Member

Choose a reason for hiding this comment

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

Duplicate with the next sentence.

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.

Comment on lines +457 to +461
Whether command-line option `-l` was set; read-only.

### `$-p`

Whether command-line option `-p` was given; read-only.
Copy link
Member

Choose a reason for hiding this comment

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

Duplicate.

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.

Comment on lines +427 to +433
### `$-a`

Whether command-line option `-a` was given; read-only.

### `$-i`

Contains the extension given with command-line option `-i`,
Copy link
Member

Choose a reason for hiding this comment

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

Duplicate with the paragraphs after $-F.

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.

Comment on lines +480 to +481
### `$;`

Copy link
Member

Choose a reason for hiding this comment

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

This is an alias of $-F, not fully-deprecated.

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.

### Streams

| Constant | Contains |
|----------|-------------------------|
Copy link
Member

Choose a reason for hiding this comment

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

Unnecessary 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.

Fixed.

Comment on lines +497 to +511
| Constant | Contains |
|-----------------------|-------------------------------------------------------------------------------|
| `ENV` | Hash of current environment variable names and values. |
| `ARGF` | String concatenation of files given on the command line, or `$stdin` if none. |
| `ARGV` | Array of the given command-line arguments. |
| `TOPLEVEL_BINDING` | Binding of the top level scope. |
| `RUBY_VERSION` | String Ruby version. |
| `RUBY_RELEASE_DATE` | String Ruby release date. |
| `RUBY_PLATFORM` | String Ruby platform. |
| `RUBY_PATCH_LEVEL` | String Ruby patch level. |
| `RUBY_REVISION` | String Ruby revision. |
| `RUBY_COPYRIGHT` | String Ruby copyright. |
| `RUBY_ENGINE` | String Ruby engine. |
| `RUBY_ENGINE_VERSION` | String Ruby engine version. |
| `RUBY_DESCRIPTION` | String Ruby description. |
Copy link
Member

Choose a reason for hiding this comment

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

Duplicate.

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.

Comment on lines 515 to 520
| Constant | Contains |
|:---------------------:|-------------------------------------------------------------------------------|
| `DATA` | File containing embedded data (lines following `__END__`, if any). |
| `ENV` | Hash of current environment variable names and values. |
| `ARGF` | String concatenation of files given on the command line, or `$stdin` if none. |
| `ARGV` | Array of the given command-line arguments. |
Copy link
Member

Choose a reason for hiding this comment

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

ENV, ARGF, etc are not "Embedded Data".

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 BurdetteLamar requested a review from nobu December 18, 2025 13:45
@BurdetteLamar BurdetteLamar marked this pull request as ready for review December 18, 2025 13:45
@BurdetteLamar
Copy link
Member Author

Don't the tables in the "In Brief" section overlap with those in the "Summary" section?

Yes, and there are other (major) repetitions. Marking as draft while I study and fix.

I had revised and extended the tables in Summary for use in In Brief, then forgot to remove the entire Summary section. Have now removed, after rolling some of its information to In Brief.

@BurdetteLamar
Copy link
Member Author

Thanks, @nobu, for working closely with me on this; I've made some careless errors (now fixed, I hope). I think this revision will make a difference to our readers.

Comment on lines +355 to +358
### `$-a`

Whether command-line option `-a` was given; read-only.

Copy link
Member

Choose a reason for hiding this comment

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

This is duplicate, $-a is written after $-F.

### `$-l`

Whether [command-line option `-l`] was set; read-only.
Whether command-line option `-l` was set; read-only.
Copy link
Member

Choose a reason for hiding this comment

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

Why removing the link here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Restored.

| `$1` | | First group matched; set by matcher method. |
| `$2` | | Second group matched; set by matcher method. |
| <tt>$_n_</tt> | | <i>n</i>th group matched; set by matcher method. |
| Variable | \English | Contains | Initially | Read-Only | Reset By |
Copy link
Member

Choose a reason for hiding this comment

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

From here to "Debugging", why are the "Variable" columns expanded?
There are enough width already, I guess.

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? (Not sure what's wanted.)

@BurdetteLamar BurdetteLamar requested a review from nobu December 19, 2025 11:15
| `$.` | `$INPUT_LINE_NUMBER`, `$NR` | Input position of most recently read stream. |
| `$_` | `$LAST_READ_LINE` | String from most recently read stream. |
| Variable | \English | Contains | Initially | Read-Only | Reset By |
|:---------:|----------------------------:|:-------------------------------------------:|:---------:|:---------:|----------------------|
Copy link
Member

Choose a reason for hiding this comment

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

Why does only this table right-align the "English" column?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops! Now fixed.

@BurdetteLamar BurdetteLamar requested a review from nobu December 20, 2025 12:54
@BurdetteLamar BurdetteLamar merged commit 5cdda61 into ruby:master Dec 20, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements to documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants