# File lib/cisco/ssh.rb, line 23 def run @inbuf = "" @results = [] @ssh = Net::SSH.start(*@sshargs) @ssh.open_channel do |chan| chan.send_channel_request("shell") do |ch, success| if !success abort "Could not open shell channel" else ch.on_data do |chn, data| @outblock.call(data) if @outblock @inbuf << data check_and_send(chn) end (@cmdbuf = [] and yield self) if block_given? @cmdbuf.insert(0, *@extra_init) if @extra_init.any? end end end @ssh.loop @results end