class Cocaine::CommandLine::ProcessRunner

Public Instance Methods

call(command, env = {}) click to toggle source
# File lib/cocaine/command_line/runners/process_runner.rb, line 6
def call(command, env = {})
  input, output = IO.pipe
  pid = spawn(env, command, :out => output)
  output.close
  result = input.read
  waitpid(pid)
  result
end
spawn(*args) click to toggle source
# File lib/cocaine/command_line/runners/process_runner.rb, line 17
def spawn(*args)
  Process.spawn(*args)
end
waitpid(pid) click to toggle source
# File lib/cocaine/command_line/runners/process_runner.rb, line 21
def waitpid(pid)
  Process.waitpid(pid)
end