Sha256: 333c047de4f82a457594999a90aa642d53648e07e9c66b84eab942b7322df1ad

Contents?: true

Size: 505 Bytes

Versions: 169

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

169 entries across 169 versions & 3 rubygems

Version Path
eac_ruby_utils-0.124.0 lib/eac_ruby_utils/envs/process.rb
eac_tools-0.97.2 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
eac_ruby_utils-0.123.0 lib/eac_ruby_utils/envs/process.rb
eac_ruby_utils-0.121.0 lib/eac_ruby_utils/envs/process.rb
eac_ruby_utils-0.120.0 lib/eac_ruby_utils/envs/process.rb
eac_tools-0.76.1 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
eac_tools-0.76.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
eac_tools-0.75.2 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
eac_ruby_utils-0.119.2 lib/eac_ruby_utils/envs/process.rb
eac_tools-0.75.1 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
eac_tools-0.75.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
eac_ruby_utils-0.119.1 lib/eac_ruby_utils/envs/process.rb
eac_tools-0.74.1 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
eac_tools-0.74.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
eac_tools-0.73.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
eac_ruby_utils-0.119.0 lib/eac_ruby_utils/envs/process.rb
eac_tools-0.72.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb
eac_ruby_utils-0.118.1 lib/eac_ruby_utils/envs/process.rb
eac_ruby_utils-0.118.0 lib/eac_ruby_utils/envs/process.rb
eac_tools-0.70.1 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb