File: C:/Ruby27-x64/share/ri/2.7.0/system/ARGF/cdesc-ARGF.ri
U:RDoc::NormalClass[iI" ARGF:ET@I"Object;To:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"P+ARGF+ is a stream designed for use in scripts that process files given as ;TI"3command-line arguments or passed in via STDIN.;To:RDoc::Markup::BlankLine o; ;[I"MThe arguments passed to your script are stored in the +ARGV+ Array, one ;TI"Iargument per element. +ARGF+ assumes that any arguments that aren't ;TI":filenames have been removed from +ARGV+. For example:;T@o:RDoc::Markup::Verbatim;[
I"*$ ruby argf.rb --verbose file1 file2
;TI"
;TI"/ARGV #=> ["--verbose", "file1", "file2"]
;TI")option = ARGV.shift #=> "--verbose"
;TI""ARGV #=> ["file1", "file2"]
;T:@format0o; ;[I"PYou can now use +ARGF+ to work with a concatenation of each of these named ;TI"Jfiles. For instance, +ARGF.read+ will return the contents of _file1_ ;TI")followed by the contents of _file2_.;T@o; ;[I"LAfter a file in +ARGV+ has been read +ARGF+ removes it from the Array. ;TI"?Thus, after all files have been read +ARGV+ will be empty.;T@o; ;[ I"OYou can manipulate +ARGV+ yourself to control what +ARGF+ operates on. If ;TI"Qyou remove a file from +ARGV+, it is ignored by +ARGF+; if you add files to ;TI"M+ARGV+, they are treated as if they were named on the command line. For ;TI"
example:;T@o;;[
I"ARGV.replace ["file1"]
;TI"@ARGF.readlines # Returns the contents of file1 as an Array
;TI"ARGV #=> []
;TI"%ARGV.replace ["file2", "file3"]
;TI">ARGF.read # Returns the contents of file2 and file3
;T;0o; ;[I"MIf +ARGV+ is empty, +ARGF+ acts as if it contained STDIN, i.e. the data ;TI"'piped to your script. For example:;T@o;;[I",$ echo "glark" | ruby -e 'p ARGF.read'
;TI""glark\n";T;0:
@fileI" io.c;T:0@omit_headings_from_table_of_contents_below0;
0;0[ [ [[I"Enumerable;To;;[ ;
I" io.c;T;0I"../ruby-2.7.7/io.c;T[[I"
class;T[[:public[ [:protected[ [:private[ [I"
instance;T[[;[;[I" argv;T@E[I"binmode;T@E[I"
binmode?;T@E[I"
bytes;T@E[I"
chars;T@E[I"
close;T@E[I"closed?;T@E[I"codepoints;T@E[I" each;T@E[I"each_byte;T@E[I"each_char;T@E[I"each_codepoint;T@E[I"each_line;T@E[I"eof;T@E[I" eof?;T@E[I"external_encoding;T@E[I" file;T@E[I"
filename;T@E[I"fileno;T@E[I"getbyte;T@E[I" getc;T@E[I" gets;T@E[I"inplace_mode;T@E[I"inplace_mode=;T@E[I"inspect;T@E[I"internal_encoding;T@E[I"lineno;T@E[I"lineno=;T@E[I"
lines;T@E[I" path;T@E[I"pos;T@E[I" pos=;T@E[I"
print;T@E[I"printf;T@E[I" putc;T@E[I" puts;T@E[I" read;T@E[I"read_nonblock;T@E[I"
readbyte;T@E[I"
readchar;T@E[I"
readline;T@E[I"readlines;T@E[I"readpartial;T@E[I"rewind;T@E[I" seek;T@E[I"set_encoding;T@E[I" skip;T@E[I" tell;T@E[I" to_a;T@E[I" to_i;T@E[I"
to_io;T@E[I" to_s;T@E[I"to_write_io;T@E[I"
write;T@E[;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;
0;0[@D@<cRDoc::TopLevel