Module: Net::SSH
- Defined in:
- lib/extensions/net/ssh.rb,
lib/net/ssh/local.rb,
lib/net/ssh/local/version.rb
Overview
:nodoc:
Defined Under Namespace
Modules: Local
Class Method Summary collapse
-
.start(host, user = nil, options = {}) {|connection| ... } ⇒ Object
Custom behaviour for localhost with no user: nothing to log in with.
Class Method Details
.start(host, user = nil, options = {}) {|connection| ... } ⇒ Object
Custom behaviour for localhost with no user: nothing to log in with
8 9 10 11 12 13 14 15 16 |
# File 'lib/extensions/net/ssh.rb', line 8 def self.start(host, user=nil, ={}, &block) return original_start(host, user, , &block) unless host == 'localhost' && user.nil? transport = Transport::Session.new(host, ) connection = Connection::Session.new(transport, {}) return connection unless block_given? yield connection end |