Class: Dk::Remote::CmdSpy
Instance Attribute Summary collapse
-
#cmd_opts ⇒ Object
readonly
Returns the value of attribute cmd_opts.
Attributes inherited from BaseCmd
#cmd_str, #host_ssh_args, #hosts, #local_cmds, #ssh_args
Instance Method Summary collapse
- #exitstatus=(value) ⇒ Object
-
#initialize(cmd_str, opts = nil) ⇒ CmdSpy
constructor
A new instance of CmdSpy.
- #run_called? ⇒ Boolean
-
#run_calls ⇒ Object
just query the firs tlocal cmd - if run for one it was run for all.
- #run_input ⇒ Object
- #ssh? ⇒ Boolean
- #stderr=(value) ⇒ Object
-
#stdout=(value) ⇒ Object
just set the first local cmd, this will have an overall effect.
Methods inherited from BaseCmd
#output_lines, #run, #ssh_cmd_str, #stderr, #stdout, #success?, #to_s
Constructor Details
Instance Attribute Details
#cmd_opts ⇒ Object (readonly)
Returns the value of attribute cmd_opts.
106 107 108 |
# File 'lib/dk/remote.rb', line 106 def cmd_opts @cmd_opts end |
Instance Method Details
#exitstatus=(value) ⇒ Object
122 |
# File 'lib/dk/remote.rb', line 122 def exitstatus=(value); @first_local_cmd_spy.exitstatus = value; end |
#run_called? ⇒ Boolean
126 |
# File 'lib/dk/remote.rb', line 126 def run_called?; @first_local_cmd_spy.scmd.start_called?; end |
#run_calls ⇒ Object
just query the firs tlocal cmd - if run for one it was run for all
125 |
# File 'lib/dk/remote.rb', line 125 def run_calls; @first_local_cmd_spy.scmd.start_calls; end |
#run_input ⇒ Object
114 115 116 117 |
# File 'lib/dk/remote.rb', line 114 def run_input return nil unless self.run_called? self.run_calls.first.input end |
#ssh? ⇒ Boolean
128 |
# File 'lib/dk/remote.rb', line 128 def ssh?; true; end |
#stderr=(value) ⇒ Object
121 |
# File 'lib/dk/remote.rb', line 121 def stderr=(value); @first_local_cmd_spy.stderr = value; end |
#stdout=(value) ⇒ Object
just set the first local cmd, this will have an overall effect
120 |
# File 'lib/dk/remote.rb', line 120 def stdout=(value); @first_local_cmd_spy.stdout = value; end |