ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- U:RDoc::AnyMethod[iI" gets:ETI" IO#gets;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"-Reads and returns data from the stream; ;TI"-assigns the return value to $_.;To:RDoc::Markup::BlankLineo; ; [I"4With no arguments given, returns the next line ;TI"Cas determined by line separator $/, or +nil+ if none:;T@o:RDoc::Markup::Verbatim; [ I"f = File.open('t.txt') ;TI"'f.gets # => "This is line one.\n" ;TI"'$_ # => "This is line one.\n" ;TI".f.gets # => "This is the second line.\n" ;TI"-f.gets # => "This is the third line.\n" ;TI"f.gets # => nil ;T: @format0o; ; [I"AWith string argument +sep+ given, but not argument +limit+, ;TI"Breturns the next line as determined by line separator +sep+, ;TI"or +nil+ if none:;T@o; ; [ I"f = File.open('t.txt') ;TI""f.gets(' is') # => "This is" ;TI".f.gets(' is') # => " line one.\nThis is" ;TI"5f.gets(' is') # => " the second line.\nThis is" ;TI"-f.gets(' is') # => " the third line.\n" ;TI"f.gets(' is') # => nil ;T; 0o; ; [I"'Note two special values for +sep+:;T@o:RDoc::Markup::List: @type: BULLET: @items[o:RDoc::Markup::ListItem: @label0; [o; ; [I"3+nil+: The entire stream is read and returned.;To;;0; [o; ; [I"L'' (empty string): The next "paragraph" is read and returned, ;TI"Bthe paragraph separator being two successive line separators.;T@o; ; [I"*With integer argument +limit+ given, ;TI"*returns up to limit+1 bytes:;T@o; ; [I"$# Text with 1-byte characters. ;TI"2File.open('t.txt') {|f| f.gets(1) } # => "T" ;TI"3File.open('t.txt') {|f| f.gets(2) } # => "Th" ;TI"4File.open('t.txt') {|f| f.gets(3) } # => "Thi" ;TI"5File.open('t.txt') {|f| f.gets(4) } # => "This" ;TI"# No more than one line. ;TI"CFile.open('t.txt') {|f| f.gets(17) } # => "This is line one." ;TI"EFile.open('t.txt') {|f| f.gets(18) } # => "This is line one.\n" ;TI"EFile.open('t.txt') {|f| f.gets(19) } # => "This is line one.\n" ;TI" ;TI"=# Text with 2-byte characters, which will not be split. ;TI"5File.open('t.rus') {|f| f.gets(1).size } # => 1 ;TI"5File.open('t.rus') {|f| f.gets(2).size } # => 1 ;TI"5File.open('t.rus') {|f| f.gets(3).size } # => 2 ;TI"5File.open('t.rus') {|f| f.gets(4).size } # => 2 ;T; 0o; ; [I"'With arguments +sep+ and +limit+, ;TI"&combines the two behaviors above:;T@o;;;;[o;;0; [o; ; [I"BReturns the next line as determined by line separator +sep+, ;TI"or +nil+ if none.;To;;0; [o; ; [I"5But returns no more than limit+1 bytes.;T@o; ; [I"LFor all forms above, trailing optional keyword arguments may be given; ;TI" "This is line one." ;TI"9f.gets(chomp: true) # => "This is the second line." ;TI"8f.gets(chomp: true) # => "This is the third line." ;TI"!f.gets(chomp: true) # => nil;T; 0: @fileI" io.c;T:0@omit_headings_from_table_of_contents_below0I"–gets(sep = $/, **getline_opts) -> string or nil gets(limit, **getline_opts) -> string or nil gets(sep, limit, **getline_opts) -> string or nil ;T0[I" (*args);T@kFI"IO;TcRDoc::NormalClass00