Class: EacRubyUtils::Envs::Process
- Defined in:
- lib/eac_ruby_utils/envs/process.rb
Constant Summary collapse
- EXIT_CODE_KEY =
:exit_code
- ERR_KEY =
:stderr
- OUT_KEY =
:stdout
Instance Method Summary collapse
-
#initialize(command) ⇒ Process
constructor
A new instance of Process.
- #to_h ⇒ Object
Constructor Details
#initialize(command) ⇒ Process
Returns a new instance of Process.
12 13 14 15 16 |
# File 'lib/eac_ruby_utils/envs/process.rb', line 12 def initialize(command) self.data = { command: command } data[OUT_KEY], data[ERR_KEY], data[EXIT_CODE_KEY] = Open3.capture3(command) data[EXIT_CODE_KEY] = data[EXIT_CODE_KEY].to_i end |
Instance Method Details
#to_h ⇒ Object
18 19 20 |
# File 'lib/eac_ruby_utils/envs/process.rb', line 18 def to_h data.dup end |