Class: Sevgi::Function::Shell::Runner Private
- Inherits:
-
Object
- Object
- Sevgi::Function::Shell::Runner
- Defined in:
- lib/sevgi/function/shell.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Runs shell commands and captures stdout, stderr, and exit status.
Instance Method Summary collapse
-
#call(*args) { ... } ⇒ Sevgi::Function::Shell::Result
private
Runs a command and captures its output.
-
#initialize ⇒ void
constructor
private
Creates a shell runner.
Constructor Details
#initialize ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a shell runner.
177 178 179 |
# File 'lib/sevgi/function/shell.rb', line 177 def initialize @coathooks = 0 end |
Instance Method Details
#call(*args) { ... } ⇒ Sevgi::Function::Shell::Result
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Runs a command and captures its output.
187 188 189 190 191 192 193 194 195 196 |
# File 'lib/sevgi/function/shell.rb', line 187 def call(*args, &input) return Result.dummy if args.empty? @coathooks = 0 outs, errs, status = Open3.popen3(*args) do |stdin, stdout, stderr, wait_thread| capture(stdin, stdout, stderr, wait_thread, &input) end Result.new(args, outs, errs, status.exitstatus) end |