Class: Jisota::SSHEngine

Inherits:
Object
  • Object
show all
Defined in:
lib/jisota/ssh_engine.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ SSHEngine

Returns a new instance of SSHEngine.



5
6
7
# File 'lib/jisota/ssh_engine.rb', line 5

def initialize(options = {})
  @engine = options.fetch(:engine) { Net::SSH }
end

Instance Method Details

#start(user:, host:, **options) ⇒ Object



9
10
11
12
13
# File 'lib/jisota/ssh_engine.rb', line 9

def start(user: , host: , **options)
  @engine.start(host, user, options) do |ssh_session|
    yield SSHSession.new(ssh_session)
  end
end