Method: EventMachine::Ssh::Shell#expect
- Defined in:
- lib/em-ssh/shell.rb
#expect(strregex, send_str = nil, opts = {}, &blk) ⇒ Shell, String
Wait for a number of seconds until a specified string or regexp is matched by the data returned from the ssh connection. Optionally send a given string first.
If a block is not provided the current Fiber will yield until strregex matches or :timeout # is reached.
If a block is provided expect will return immediately.
310 311 312 313 314 315 316 |
# File 'lib/em-ssh/shell.rb', line 310 def expect(strregex, send_str = nil, opts = {}, &blk) assert_channel! shell.expect(strregex, send_str, {:timeout => @timeout, :log => self }.merge(opts), &blk) end |