Sha256: e738541be07064fee0f05552b57982ffb3312b1f5c2899798a43719e84275a48

Contents?: true

Size: 423 Bytes

Versions: 24

Compression:

Stored size: 423 Bytes

Contents

require 'English'

module Quality
  # Wrapper around IO.popen that allows exit status to be mocked in tests.
  class Process
    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 if $CHILD_STATUS
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
quality-22.0.0 lib/quality/process.rb
quality-21.0.6 lib/quality/process.rb
quality-21.0.5 lib/quality/process.rb
quality-21.0.4 lib/quality/process.rb
quality-21.0.3 lib/quality/process.rb
quality-21.0.2 lib/quality/process.rb
quality-21.0.1 lib/quality/process.rb
quality-20.1.1 lib/quality/process.rb
quality-21.0.0 lib/quality/process.rb
quality-20.1.0 lib/quality/process.rb
quality-20.0.3 lib/quality/process.rb
quality-20.0.2 lib/quality/process.rb
quality-20.0.1 lib/quality/process.rb
quality-20.0.0 lib/quality/process.rb
quality-19.2.1 lib/quality/process.rb
quality-19.2.0 lib/quality/process.rb
quality-19.1.3 lib/quality/process.rb
quality-19.1.2 lib/quality/process.rb
quality-19.1.1 lib/quality/process.rb
quality-19.1.0 lib/quality/process.rb