Module: Exit_0::Child::Base
- Included in:
- Exit_0::Child
- Defined in:
- lib/Exit_0.rb
Instance Attribute Summary collapse
-
#child ⇒ Object
readonly
Returns the value of attribute child.
-
#cmd ⇒ Object
readonly
Returns the value of attribute cmd.
Instance Method Summary collapse
Instance Attribute Details
#child ⇒ Object (readonly)
Returns the value of attribute child.
58 59 60 |
# File 'lib/Exit_0.rb', line 58 def child @child end |
#cmd ⇒ Object (readonly)
Returns the value of attribute cmd.
58 59 60 |
# File 'lib/Exit_0.rb', line 58 def cmd @cmd end |
Instance Method Details
#initialize(*cmd) ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/Exit_0.rb', line 59 def initialize *cmd if cmd[0].is_a?(String) if cmd[0]["\n"] cmd[0] = begin cmd[0] .split("\n") .map(&:strip) .reject(&:empty?) .join(" && ") end end cmd[0] = "bash -lc #{cmd[0].inspect}" end @child = POSIX::Spawn::Child.new(*cmd) @cmd = cmd.join(' ') end |
#split_lines ⇒ Object
79 80 81 |
# File 'lib/Exit_0.rb', line 79 def split_lines Split_Lines(child.out) end |
#status ⇒ Object
95 96 97 |
# File 'lib/Exit_0.rb', line 95 def status child.status end |