core/rbs/unnamed/argf.rbs in rbs-3.3.2 vs core/rbs/unnamed/argf.rbs in rbs-3.4.0.pre.1

- old
+ new

@@ -29,16 +29,20 @@ # ARGF.readlines # Returns the contents of file1 as an Array # ARGV #=> [] # 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 `"-"` 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" + # %a{annotate:rdoc:copy:ARGF} class ARGFClass include Enumerable[String] public @@ -823,23 +827,25 @@ %a{annotate:rdoc:copy:ARGF#readline} def readline: (?String sep, ?Integer limit) -> String # <!-- # rdoc-file=io.c - # - ARGF.readlines(sep = $/) -> array - # - ARGF.readlines(limit) -> array - # - ARGF.readlines(sep, limit) -> array - # - ARGF.to_a(sep = $/) -> array - # - ARGF.to_a(limit) -> array - # - ARGF.to_a(sep, limit) -> array + # - ARGF.readlines(sep = $/, chomp: false) -> array + # - ARGF.readlines(limit, chomp: false) -> array + # - ARGF.readlines(sep, limit, chomp: false) -> array + # - ARGF.to_a(sep = $/, chomp: false) -> array + # - ARGF.to_a(limit, chomp: false) -> array + # - ARGF.to_a(sep, limit, chomp: false) -> array # --> # Reads each file in ARGF in its entirety, returning an Array containing lines # from the files. Lines are assumed to be separated by *sep*. # # lines = ARGF.readlines # lines[0] #=> "This is line one\n" # + # See `IO.readlines` for a full description of all options. + # %a{annotate:rdoc:copy:ARGF#readlines} def readlines: (?String sep, ?Integer limit) -> ::Array[String] # <!-- # rdoc-file=io.c @@ -953,9 +959,11 @@ # Reads each file in ARGF in its entirety, returning an Array containing lines # from the files. Lines are assumed to be separated by *sep*. # # lines = ARGF.readlines # lines[0] #=> "This is line one\n" + # + # See `IO.readlines` for a full description of all options. # %a{annotate:rdoc:copy:ARGF#to_a} def to_a: (?String sep, ?Integer limit) -> ::Array[String] # <!-- rdoc-file=io.c -->