Class: CobraCommander::Executor::ComponentExec
- Inherits:
-
Object
- Object
- CobraCommander::Executor::ComponentExec
- Defined in:
- lib/cobra_commander/executor/component_exec.rb
Overview
Execute a command on a single component
Instance Method Summary collapse
-
#initialize(component) ⇒ ComponentExec
constructor
A new instance of ComponentExec.
- #run(command, output: $stdout, **cmd_options) ⇒ Object
Constructor Details
#initialize(component) ⇒ ComponentExec
9 10 11 |
# File 'lib/cobra_commander/executor/component_exec.rb', line 9 def initialize(component) @component = component end |
Instance Method Details
#run(command, output: $stdout, **cmd_options) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/cobra_commander/executor/component_exec.rb', line 13 def run(command, output: $stdout, **) tty = TTY::Command.new(pty: true, printer: :quiet, output: output) Bundler.with_original_env do @component.root_paths.all? do |path| tty.run!(command, chdir: path, **).success? end end end |