Sha256: 97d22d0bb3e29d009745d8013cd2d8d45a4aa235c147eb6cb20094b5e63acd95

Contents?: true

Size: 412 Bytes

Versions: 21

Compression:

Stored size: 412 Bytes

Contents

require 'English'

module Quality
  # Wrapper around IO.popen that allows exit status to be mocked in tests.
  class ProcessRunner
    def initialize(full_cmd,
                   dependencies = {})
      @full_cmd = full_cmd
      @popener = dependencies[:popener] || IO
    end

    def run
      @popener.popen(@full_cmd) do |file|
        yield file
      end
      $CHILD_STATUS.exitstatus
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
quality-13.0.0 lib/quality/process_runner.rb
quality-12.0.0 lib/quality/process_runner.rb
quality-11.0.0 lib/quality/process_runner.rb
quality-10.0.0 lib/quality/process_runner.rb
quality-9.0.0 lib/quality/process_runner.rb
quality-8.1.1 lib/quality/process_runner.rb
quality-8.1.0 lib/quality/process_runner.rb
quality-8.0.0 lib/quality/process_runner.rb
quality-7.0.0 lib/quality/process_runner.rb
quality-6.0.0 lib/quality/process_runner.rb
quality-5.0.1 lib/quality/process_runner.rb
quality-5.0.0 lib/quality/process_runner.rb
quality-4.0.2 lib/quality/process_runner.rb
quality-4.0.1 lib/quality/process_runner.rb
quality-4.0.0 lib/quality/process_runner.rb
quality-3.1.0 lib/quality/process_runner.rb
quality-3.0.0 lib/quality/process_runner.rb
quality-2.1.1 lib/quality/process_runner.rb
quality-2.1.0 lib/quality/process_runner.rb
quality-2.0.1 lib/quality/process_runner.rb