Sha256: 6e891be46e1ee0a243423340a58d458d68c161d589260a6e7f6a3a183ab2f41b

Contents?: true

Size: 522 Bytes

Versions: 5

Compression:

Stored size: 522 Bytes

Contents

# coding: UTF-8

module Cocaine
  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|
            pipe.read
          end
        end
      end

      private

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

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
solidus_backend-1.0.0.pre3 vendor/bundle/gems/cocaine-0.5.7/lib/cocaine/command_line/runners/popen_runner.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/cocaine-0.5.7/lib/cocaine/command_line/runners/popen_runner.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/cocaine-0.5.7/lib/cocaine/command_line/runners/popen_runner.rb
cocaine-0.5.7 lib/cocaine/command_line/runners/popen_runner.rb
cocaine-0.5.4 lib/cocaine/command_line/runners/popen_runner.rb