Class: PrepKit::Remote
- Inherits:
-
Object
- Object
- PrepKit::Remote
- Defined in:
- lib/prep_kit/remote.rb
Instance Method Summary collapse
- #exec!(command) ⇒ Object
-
#initialize(host, user, options, &callback) ⇒ Remote
constructor
A new instance of Remote.
- #test?(name, option = nil) ⇒ Boolean
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, , &callback) @ssh, @scp = create_connection(host, user, , &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
17 18 19 |
# File 'lib/prep_kit/remote.rb', line 17 def test?(name, option = nil) exec!(%([ #{option} #{name} ])) end |