Class: RemoteExec::Fake
Overview
Class to fake running commands and transfering files.
Instance Attribute Summary collapse
-
#story ⇒ Array
The story to tell in
execute
, take an array.
Instance Method Summary collapse
-
#execute(command) ⇒ Integer
Execute fake command.
-
#initialize {|self| ... } ⇒ Fake
constructor
Constructs a new Fake object.
Methods inherited from Base
Constructor Details
#initialize {|self| ... } ⇒ Fake
Constructs a new Fake object.
29 30 31 32 |
# File 'lib/remote-exec/fake.rb', line 29 def initialize after_connect.changed_and_notify(self) super end |
Instance Attribute Details
#story ⇒ Array
The story to tell in execute
, take an array
21 22 23 |
# File 'lib/remote-exec/fake.rb', line 21 def story @story end |
Instance Method Details
#execute(command) ⇒ Integer
Execute fake command
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/remote-exec/fake.rb', line 40 def execute(command) before_execute.changed_and_notify(self, command) last_status, outputs = @story outputs.each do |out, err| on_execute_data.changed_and_notify(self, out, err) yield(out, err) if block_given? end after_execute.changed_and_notify(self, command, last_status) last_status end |