Class: CobraCommander::Executor::Script
- Inherits:
-
Object
- Object
- CobraCommander::Executor::Script
- Includes:
- RunScript
- Defined in:
- lib/cobra_commander/executor/script.rb
Overview
This is a script job. It can target any CobraCommander::Component.
Script runs the given script once for each Component#root_paths
Instance Method Summary collapse
-
#call(tty, component) ⇒ Array<Symbol, String>
Runs the script in the given component.
-
#initialize(script) ⇒ Script
constructor
A new instance of Script.
Methods included from RunScript
Constructor Details
#initialize(script) ⇒ Script
Returns a new instance of Script.
12 13 14 |
# File 'lib/cobra_commander/executor/script.rb', line 12 def initialize(script) @script = script end |
Instance Method Details
#call(tty, component) ⇒ Array<Symbol, String>
Runs the script in the given component
It runs the script once for each Component#root_paths. If a component has two packages in the same path, it will run the script only once.
24 25 26 |
# File 'lib/cobra_commander/executor/script.rb', line 24 def call(tty, component) run_many(component.root_paths) { run_script(tty, @script, _1) } end |