Method: Net::SSH::Shell#open

Defined in:
lib/net/ssh/shell.rb

#open(&callback) ⇒ Object



27
28
29
30
31
32
33
34
35
36
# File 'lib/net/ssh/shell.rb', line 27

def open(&callback)
  if closed?
    @state = :opening
    @channel = session.open_channel(&method(:open_succeeded))
    @channel.on_open_failed(&method(:open_failed))
    @channel.on_request('exit-status', &method(:on_exit_status))
  end
  when_open(&callback) if callback
  self
end