Skip to content

Commit 5ac8c5d

Browse files
committed
Update documentation for #gets
Add a sentence documenting the new limit argument. Took this sentence from Ruby's IO documentation. https://ruby-doc.org/core-2.5.1/IO.html#method-i-gets
1 parent 330e0b2 commit 5ac8c5d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/net/sftp/operations/file.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ def read(n=nil)
8181
# Reads up to the next instance of +sep_string+ in the stream, and
8282
# returns the bytes read (including +sep_string+). If +sep_string+ is
8383
# omitted, it defaults to +$/+. If EOF is encountered before any data
84-
# could be read, #gets will return +nil+.
84+
# could be read, #gets will return +nil+. If the first argument is an
85+
# integer, or optional second argument is given, the returning string
86+
# would not be longer than the given value in bytes.
8587
def gets(sep_or_limit=$/, limit=Float::INFINITY)
8688
if sep_or_limit.is_a? Integer
8789
sep_string = $/

0 commit comments

Comments
 (0)