Class: EacRubyUtils::Envs::Process

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_ruby_utils/envs/process.rb

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ Process

Returns a new instance of Process.


8
9
10
11
12
# File 'lib/eac_ruby_utils/envs/process.rb', line 8

def initialize(command)
  @data = { command: command }
  @data[:stdout], @data[:stderr], @data[:exit_code] = Open3.capture3(command)
  @data[:exit_code] = @data[:exit_code].to_i
end

Instance Method Details

#to_hObject


14
15
16
# File 'lib/eac_ruby_utils/envs/process.rb', line 14

def to_h
  @data.dup
end