Class: Pike::SSH::Runner
- Inherits:
-
Object
- Object
- Pike::SSH::Runner
- Defined in:
- lib/pike/ssh/runner.rb
Constant Summary collapse
- SUDO_PATTERN =
/\[sudo\] password for .+:\s*$/
Class Method Summary collapse
-
.run(connection, cmd) ⇒ Object
Simple method to run commands on a connection.
Instance Method Summary collapse
-
#initialize(connection, cmd) ⇒ Runner
constructor
Constructor.
-
#run! ⇒ Object
Executes the process of the current Runner instance.
Constructor Details
Class Method Details
.run(connection, cmd) ⇒ Object
Simple method to run commands on a connection
37 38 39 40 |
# File 'lib/pike/ssh/runner.rb', line 37 def self.run(connection, cmd) ins = self.new connection, cmd ins.run! end |
Instance Method Details
#run! ⇒ Object
Executes the process of the current Runner instance
25 26 27 28 29 30 |
# File 'lib/pike/ssh/runner.rb', line 25 def run! @connection.open_channel &method(:run) @connection.wait! return @process end |