class Terrapin::CommandLine::PosixRunner
Public Class Methods
available?()
click to toggle source
# File lib/terrapin/command_line/runners/posix_runner.rb, line 6 def self.available? return @available unless @available.nil? @available = posix_spawn_gem_available? end
supported?()
click to toggle source
# File lib/terrapin/command_line/runners/posix_runner.rb, line 12 def self.supported? available? && !OS.java? end
Private Class Methods
posix_spawn_gem_available?()
click to toggle source
# File lib/terrapin/command_line/runners/posix_runner.rb, line 39 def self.posix_spawn_gem_available? require 'posix/spawn' true rescue LoadError false end
Public Instance Methods
call(command, env = {}, options = {})
click to toggle source
# File lib/terrapin/command_line/runners/posix_runner.rb, line 20 def call(command, env = {}, options = {}) pipe = MultiPipe.new pid = spawn(env, command, options.merge(pipe.pipe_options)) pipe.read_and_then do waitpid(pid) end pipe.output end
supported?()
click to toggle source
# File lib/terrapin/command_line/runners/posix_runner.rb, line 16 def supported? self.class.supported? end
Private Instance Methods
spawn(*args)
click to toggle source
# File lib/terrapin/command_line/runners/posix_runner.rb, line 31 def spawn(*args) POSIX::Spawn.spawn(*args) end
waitpid(pid)
click to toggle source
# File lib/terrapin/command_line/runners/posix_runner.rb, line 35 def waitpid(pid) Process.waitpid(pid) end