summaryrefslogtreecommitdiff
path: root/ext/pty/lib
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pty/lib')
-rw-r--r--ext/pty/lib/expect.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/pty/lib/expect.rb b/ext/pty/lib/expect.rb
index 08191b05b9..50d2fbd363 100644
--- a/ext/pty/lib/expect.rb
+++ b/ext/pty/lib/expect.rb
@@ -1,6 +1,12 @@
$expect_verbose = false
class IO
+ # Reads ios until pattern matches or the timeout is over. It returns
+ # an array with the read buffer, followed by the matches. If a block is given,
+ # the result is yielded to the block and returns nil. The optional timeout parameter defines,
+ # in seconds, the total time to wait for pattern. If it is over of eof is found, it
+ # returns/yields nil. However, the buffer in a timeout session is kept for the next expect call.
+ # The default timeout is 9999999 seconds.
def expect(pat,timeout=9999999)
buf = ''
case pat