Class: Aruba::Processes::DebugProcess
- Inherits:
-
BasicProcess
- Object
- BasicProcess
- Aruba::Processes::DebugProcess
- Defined in:
- lib/aruba/processes/debug_process.rb
Overview
Run your command in ‘system()` to make debugging it easier. This will make the process use the default input and output streams so the developer can interact with it directly. This means that part of Aruba’s functionality is disabled. I.e., checks for output, and passing input programmatically will not work.
‘DebugProcess` is not meant for direct use - `DebugProcess.new` - by users. Only its public methods are part of the public API of aruba, e.g. `#stdin`, `#stdout`.
Instance Attribute Summary
Attributes inherited from BasicProcess
#environment, #exit_status, #exit_timeout, #io_wait_timeout, #main_class, #startup_wait_time, #stop_signal, #working_directory
Class Method Summary collapse
-
.match?(mode) ⇒ Boolean
Use only if mode is :debug.
Instance Method Summary collapse
-
#close_io ⇒ Object
Close nothing.
- #interactive? ⇒ Boolean
- #start ⇒ Object
-
#stderr ⇒ String
Return stderr.
-
#stdin ⇒ NilClass
Return stdin.
-
#stdout ⇒ String
Return stdout.
-
#stop ⇒ Object
Stop process.
-
#terminate ⇒ Object
Terminate process.
-
#write ⇒ Object
Write to nothing.
Methods inherited from BasicProcess
#after_run, #arguments, #before_run, #command, #commandline, #content, #empty?, #filesystem_status, #initialize, #inspect, #output, #pid, #restart, #send_signal, #started?, #stopped?, #timed_out?, #wait
Constructor Details
This class inherits a constructor from Aruba::Processes::BasicProcess
Class Method Details
.match?(mode) ⇒ Boolean
Use only if mode is :debug
22 23 24 |
# File 'lib/aruba/processes/debug_process.rb', line 22 def self.match?(mode) mode == :debug || (mode.is_a?(Class) && mode <= DebugProcess) end |
Instance Method Details
#close_io ⇒ Object
Close nothing
63 |
# File 'lib/aruba/processes/debug_process.rb', line 63 def close_io(*); end |
#interactive? ⇒ Boolean
77 78 79 |
# File 'lib/aruba/processes/debug_process.rb', line 77 def interactive? true end |
#start ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/aruba/processes/debug_process.rb', line 26 def start @started = true Dir.chdir @working_directory do Aruba.platform.with_replaced_environment(environment) do @exit_status = system(command, *arguments) ? 0 : 1 end end end |
#stderr ⇒ String
Return stderr
54 55 56 57 |
# File 'lib/aruba/processes/debug_process.rb', line 54 def stderr(*) 'This is the debug launcher on STDERR. ' \ 'If this output is unexpected, please check your setup.' end |
#stdin ⇒ NilClass
Return stdin
39 |
# File 'lib/aruba/processes/debug_process.rb', line 39 def stdin(*); end |
#stdout ⇒ String
Return stdout
45 46 47 48 |
# File 'lib/aruba/processes/debug_process.rb', line 45 def stdout(*) 'This is the debug launcher on STDOUT. ' \ 'If this output is unexpected, please check your setup.' end |
#stop ⇒ Object
Stop process
66 67 68 69 70 |
# File 'lib/aruba/processes/debug_process.rb', line 66 def stop(*) @started = false @exit_status end |
#terminate ⇒ Object
Terminate process
73 74 75 |
# File 'lib/aruba/processes/debug_process.rb', line 73 def terminate(*) stop end |
#write ⇒ Object
Write to nothing
60 |
# File 'lib/aruba/processes/debug_process.rb', line 60 def write(*); end |