Class: Cocaine::CommandLine::PopenRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/cocaine/command_line/runners/popen_runner.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.supported?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/cocaine/command_line/runners/popen_runner.rb', line 6

def self.supported?
  true
end

Instance Method Details

#call(command, env = {}) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/cocaine/command_line/runners/popen_runner.rb', line 14

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

#supported?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/cocaine/command_line/runners/popen_runner.rb', line 10

def supported?
  self.class.supported?
end