method
expect
v1_9_3_125 -
Show latest stable
-
0 notes -
Class: IO
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378 (0)
- 1_9_2_180 (38)
- 1_9_3_125 (3)
- 1_9_3_392 (0)
- 2_1_10 (36)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
expect(pat,timeout=9999999)
public
Reads from the IO until pattern pat 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 the pattern. If the timeout expires or eof is found, nil is returned or yielded. However, the buffer in a timeout session is kept for the next expect call. The default timeout is 9999999 seconds.