Class: Terrapin::CommandLine::ProcessRunner
- Inherits:
-
Object
- Object
- Terrapin::CommandLine::ProcessRunner
- Defined in:
- lib/terrapin/command_line/runners/process_runner.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.available? ⇒ Boolean
6 7 8 |
# File 'lib/terrapin/command_line/runners/process_runner.rb', line 6 def self.available? Process.respond_to?(:spawn) end |
.supported? ⇒ Boolean
10 11 12 |
# File 'lib/terrapin/command_line/runners/process_runner.rb', line 10 def self.supported? available? && !OS.java? end |
Instance Method Details
#call(command, env = {}, options = {}) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/terrapin/command_line/runners/process_runner.rb', line 18 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
14 15 16 |
# File 'lib/terrapin/command_line/runners/process_runner.rb', line 14 def supported? self.class.supported? end |