Class: Polytrix::Runners::MixlibShellOutExecutor
- Inherits:
-
Object
- Object
- Polytrix::Runners::MixlibShellOutExecutor
- Includes:
- DefaultLogger
- Defined in:
- lib/polytrix/runners/mixlib_shellout_executor.rb
Defined Under Namespace
Classes: OutputDecorator
Instance Method Summary collapse
Methods included from DefaultLogger
Methods included from DefaultLogger::ClassMethods
Instance Method Details
#execute(command, opts) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/polytrix/runners/mixlib_shellout_executor.rb', line 32 def execute(command, opts) prefix = opts.delete :prefix shell = Mixlib::ShellOut.new(command, opts) shell.live_stream = log_decorator $stdout, prefix shell.run_command execution_result = ExecutionResult.new exitstatus: shell.exitstatus, stdout: shell.stdout, stderr: shell.stderr begin shell.error! rescue Mixlib::ShellOut::ShellCommandFailed => e execution_error = ExecutionError.new(e) execution_error.execution_result = execution_result raise execution_error end execution_result end |