Class: Terrapin::CommandLine::PosixRunner
- Inherits:
-
Object
- Object
- Terrapin::CommandLine::PosixRunner
- Defined in:
- lib/terrapin/command_line/runners/posix_runner.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.available? ⇒ Boolean
6 7 8 9 10 |
# 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? ⇒ Boolean
12 13 14 |
# File 'lib/terrapin/command_line/runners/posix_runner.rb', line 12 def self.supported? available? && !OS.java? end |
Instance Method Details
#call(command, env = {}, options = {}) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/terrapin/command_line/runners/posix_runner.rb', line 20 def call(command, env = {}, = {}) pipe = MultiPipe.new pid = spawn(env, command, .merge(pipe.)) pipe.read_and_then do waitpid(pid) end pipe.output end |
#supported? ⇒ Boolean
16 17 18 |
# File 'lib/terrapin/command_line/runners/posix_runner.rb', line 16 def supported? self.class.supported? end |