Class: WideEvent::Setup::CommandRunner
- Inherits:
-
Object
- Object
- WideEvent::Setup::CommandRunner
- Defined in:
- lib/wide_event/setup/command_runner.rb
Overview
Runs one external command (Kamal, in practice) via Open3.capture3 and
reduces it to the three things WideEvent::Setup::Checker actually
needs: whether it succeeded, and its stdout/stderr text. argv is
always an array of literal strings (the executable and its arguments,
never a single shell string), so no argument is ever re-interpreted by
a shell. This is the only piece of Checker that ever shells out; every
test replaces it with a fake that returns canned Results instead.
Defined Under Namespace
Classes: Result
Instance Method Summary collapse
Instance Method Details
#call(argv) ⇒ Object
19 20 21 22 |
# File 'lib/wide_event/setup/command_runner.rb', line 19 def call(argv) stdout, stderr, status = Open3.capture3(*argv) Result.new(stdout: stdout, stderr: stderr, success: status.success?) end |