Sha256: 333c047de4f82a457594999a90aa642d53648e07e9c66b84eab942b7322df1ad

Contents?: true

Size: 505 Bytes

Versions: 167

Compression:

Stored size: 505 Bytes

Contents

# frozen_string_literal: true

require 'open3'

module EacRubyUtils
  module Envs
    class Process
      EXIT_CODE_KEY = :exit_code
      ERR_KEY = :stderr
      OUT_KEY = :stdout

      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

      def to_h
        data.dup
      end

      private

      attr_accessor :data
    end
  end
end

Version data entries

167 entries across 167 versions & 3 rubygems

Version Path
eac_ruby_utils-0.95.3 lib/eac_ruby_utils/envs/process.rb
eac_tools-0.8.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
eac_tools-0.7.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
eac_tools-0.6.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
eac_tools-0.5.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
eac_ruby_utils-0.95.2 lib/eac_ruby_utils/envs/process.rb
eac_tools-0.4.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
avm-tools-0.120.2 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
avm-tools-0.120.1 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
avm-tools-0.120.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
avm-tools-0.119.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
avm-tools-0.118.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
avm-tools-0.117.3 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
avm-tools-0.117.2 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
eac_ruby_utils-0.95.1 lib/eac_ruby_utils/envs/process.rb
avm-tools-0.117.1 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
eac_ruby_utils-0.95.0 lib/eac_ruby_utils/envs/process.rb
avm-tools-0.117.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
avm-tools-0.116.2 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
eac_ruby_utils-0.94.2 lib/eac_ruby_utils/envs/process.rb