Class: Cuoco::Runner
- Inherits:
-
Object
- Object
- Cuoco::Runner
- Defined in:
- lib/cuoco/runner.rb
Constant Summary collapse
- SERVER_ROLES =
%Q{`echo '$CAPISTRANO:HOSTROLES$' | awk '{sub(/^/,"role["); sub(/$/,"]"); gsub(/,/,"],role["); print}'`}
Instance Method Summary collapse
-
#initialize(capistrano) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
- #run_list(roles_and_recipes) ⇒ Object
Constructor Details
#initialize(capistrano) ⇒ Runner
Returns a new instance of Runner.
9 10 11 |
# File 'lib/cuoco/runner.rb', line 9 def initialize(capistrano) @cap = capistrano end |
Instance Method Details
#run ⇒ Object
13 14 15 |
# File 'lib/cuoco/runner.rb', line 13 def run run_list(SERVER_ROLES) end |
#run_list(roles_and_recipes) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/cuoco/runner.rb', line 17 def run_list(roles_and_recipes) if roles_and_recipes.is_a? Array roles_and_recipes = roles_and_recipes.join(',') end @cap.sudo(chef_command(roles_and_recipes), :shell => '/bin/bash') end |