Module: Net::SSH
- Defined in:
- lib/ssh/local_session.rb
Class Method Summary collapse
Class Method Details
.with_session(options, &block) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/ssh/local_session.rb', line 5 def self.with_session(, &block) if .delete(:local) block.call(Net::SSH::Connection::LocalSession.new) else start(.delete(:hostname), .delete(:username), .compact) do |ssh| block.call(ssh) end end end |