Class: CleoQualityReview::CommandRunner
- Inherits:
-
Object
- Object
- CleoQualityReview::CommandRunner
- Defined in:
- lib/cleo_quality_review/command_runner.rb
Overview
Executes shell commands and captures output
Instance Method Summary collapse
-
#run(*command, env: {}, stdin_data: nil) ⇒ CommandResult
Run a shell command and capture its output.
Instance Method Details
#run(*command, env: {}, stdin_data: nil) ⇒ CommandResult
Run a shell command and capture its output
17 18 19 20 21 22 23 24 25 |
# File 'lib/cleo_quality_review/command_runner.rb', line 17 def run(*command, env: {}, stdin_data: nil) stdout, stderr, status = if stdin_data.nil? Open3.capture3(env, *command) else Open3.capture3(env, *command, stdin_data: stdin_data) end CommandResult.new(stdout: stdout, stderr: stderr, status: status) end |