Sha256: ee38abca19d6ba8b1b8523d2603cb785b00912d751b201223eb1f74bb5278586

Contents?: true

Size: 535 Bytes

Versions: 6

Compression:

Stored size: 535 Bytes

Contents

# coding: UTF-8

module Terrapin
  class CommandLine
    class PopenRunner
      def self.supported?
        true
      end

      def supported?
        self.class.supported?
      end

      def call(command, env = {}, options = {})
        with_modified_environment(env) do
          IO.popen(command, "r", options) do |pipe|
            Output.new(pipe.read)
          end
        end
      end

      private

      def with_modified_environment(env, &block)
        ClimateControl.modify(env, &block)
      end
    end
  end
end

Version data entries

6 entries across 5 versions & 2 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/terrapin-1.0.1/lib/terrapin/command_line/runners/popen_runner.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/terrapin-1.0.1/lib/terrapin/command_line/runners/popen_runner.rb
terrapin-1.0.1 lib/terrapin/command_line/runners/popen_runner.rb
terrapin-1.0.0 lib/terrapin/command_line/runners/popen_runner.rb
terrapin-0.6.0 lib/terrapin/command_line/runners/popen_runner.rb
terrapin-0.6.0.alpha lib/terrapin/command_line/runners/popen_runner.rb