Class: Aruba::Processes::DebugProcess
- Inherits:
-
BasicProcess
- Object
- BasicProcess
- Aruba::Processes::DebugProcess
- Defined in:
- lib/aruba/processes/debug_process.rb
Overview
Run your command in systemd()
to make debugging it easier
DebugProcess
is not meant for direct use - InProcess.new
- by
users. Only it's 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, #working_directory
Class Method Summary collapse
-
.match?(mode) ⇒ Boolean
Use only if mode is :debug.
Instance Method Summary collapse
-
#close_io ⇒ Object
Close nothing.
- #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, #before_run, #commandline, #content, #filesystem_status, #initialize, #inspect, #output, #pid, #restart, #run!, #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
16 17 18 |
# File 'lib/aruba/processes/debug_process.rb', line 16 def self.match?(mode) mode == :debug || (mode.is_a?(Class) && mode <= DebugProcess) end |
Instance Method Details
#close_io ⇒ Object
Close nothing
54 |
# File 'lib/aruba/processes/debug_process.rb', line 54 def close_io(*); end |
#start ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/aruba/processes/debug_process.rb', line 20 def start Dir.chdir @working_directory do Aruba.platform.with_environment(environment) do @exit_status = system(command, *arguments) ? 0 : 1 end end end |
#stderr ⇒ String
Return stderr
46 47 48 |
# File 'lib/aruba/processes/debug_process.rb', line 46 def stderr(*) 'This is the debug launcher on STDERR. If this output is unexpected, please check your setup.' end |
#stdin ⇒ NilClass
Return stdin
32 |
# File 'lib/aruba/processes/debug_process.rb', line 32 def stdin(*); end |
#stdout ⇒ String
Return stdout
38 39 40 |
# File 'lib/aruba/processes/debug_process.rb', line 38 def stdout(*) 'This is the debug launcher on STDOUT. If this output is unexpected, please check your setup.' end |
#stop ⇒ Object
Stop process
57 58 59 60 61 |
# File 'lib/aruba/processes/debug_process.rb', line 57 def stop(*) @started = false @exit_status end |
#terminate ⇒ Object
Terminate process
64 65 66 |
# File 'lib/aruba/processes/debug_process.rb', line 64 def terminate(*) stop end |
#write ⇒ Object
Write to nothing
51 |
# File 'lib/aruba/processes/debug_process.rb', line 51 def write(*); end |