This commit is contained in:
Nobuyoshi Nakada 2023-09-16 11:45:43 +09:00
Родитель 2dffd36504
Коммит 72772a3caa
2 изменённых файлов: 14 добавлений и 6 удалений

Просмотреть файл

@ -269,6 +269,8 @@ Whether command-line option <tt>-a</tt> was given; read-only.
Contains the extension given with command-line option <tt>-i</tt>,
or +nil+ if none.
An alias of ARGF.inplace_mode.
==== <tt>$-l</tt>
Whether command-line option <tt>-l</tt> was set; read-only.
@ -307,7 +309,7 @@ The standard error stream (the default value for <tt>$stderr</tt>):
=== Enviroment
==== <tt>ENV</tt>
==== ENV
A hash of the contains current environment variables names and values:
@ -319,10 +321,11 @@ A hash of the contains current environment variables names and values:
["DISPLAY", ":0"],
["GDMSESSION", "ubuntu"]]
==== <tt>ARGF</tt>
==== ARGF
The virtual concatenation of the files given on the command line,
or from <tt>$stdin</tt> if no files were given.
The virtual concatenation of the files given on the command line, or from
<tt>$stdin</tt> if no files were given, <tt>"-"</tt> is given, or after
all files have been read.
==== <tt>ARGV</tt>

9
io.c
Просмотреть файл

@ -14625,11 +14625,16 @@ set_LAST_READ_LINE(VALUE val, ID _x, VALUE *_y)
* ARGV.replace ["file2", "file3"]
* ARGF.read # Returns the contents of file2 and file3
*
* If +ARGV+ is empty, ARGF acts as if it contained STDIN, i.e. the data
* piped to your script. For example:
* If +ARGV+ is empty, ARGF acts as if it contained <tt>"-"</tt> that
* makes ARGF read from STDIN, i.e. the data piped or typed to your
* script. For example:
*
* $ echo "glark" | ruby -e 'p ARGF.read'
* "glark\n"
*
* $ echo Glark > file1
* $ echo "glark" | ruby -e 'p ARGF.read' -- - file1
* "glark\nGlark\n"
*/
/*