Class: RemoteExec::Local
Overview
Class to run local commands and transfer files localy.
Instance Attribute Summary collapse
-
#shell ⇒ Object
readonly
name of the shell to run.
Instance Method Summary collapse
-
#execute(command) ⇒ Integer
Execute command locally.
-
#initialize(shell = "sh") {|self| ... } ⇒ Local
constructor
Constructs a new Local object.
Methods inherited from Base
Constructor Details
#initialize(shell = "sh") {|self| ... } ⇒ Local
Constructs a new Local object.
22 23 24 25 |
# File 'lib/remote-exec/local.rb', line 22 def initialize(shell = "sh") @shell = shell super() end |
Instance Attribute Details
#shell ⇒ Object (readonly)
name of the shell to run
13 14 15 |
# File 'lib/remote-exec/local.rb', line 13 def shell @shell end |
Instance Method Details
#execute(command) ⇒ Integer
Execute command locally
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/remote-exec/local.rb', line 33 def execute(command) before_execute.changed_and_notify(self, command) shell_session.execute(command) do |out,err| on_execute_data.changed_and_notify(self, out, err) yield(out, err) if block_given? end last_status = shell_session.status after_execute.changed_and_notify(self, command, last_status) last_status end |