Class: PrepKit::Remote

Inherits:
Object
  • Object
show all
Defined in:
lib/prep_kit/remote.rb

Instance Method Summary collapse

Constructor Details

#initialize(host, user, options, &callback) ⇒ Remote

Returns a new instance of Remote.



3
4
5
# File 'lib/prep_kit/remote.rb', line 3

def initialize(host, user, options, &callback)
  @ssh, @scp = create_connection(host, user, options, &callback)
end

Instance Method Details

#exec!(command) ⇒ Object



7
8
9
# File 'lib/prep_kit/remote.rb', line 7

def exec!(command)
  @ssh.(command)
end

#test?(name, option = nil) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/prep_kit/remote.rb', line 17

def test?(name, option = nil)
  exec!(%([ #{option} #{name} ]))
end