Class: Chef::Recipe

Inherits:
Object
  • Object
show all
Defined in:
lib/engineyard-hudson/cli/install/templates/cookbooks/main/libraries/run_for_app.rb,
lib/engineyard-hudson/cli/install_server/templates/cookbooks/main/libraries/run_for_app.rb

Instance Method Summary collapse

Instance Method Details

#run_for_app(*apps, &block) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/engineyard-hudson/cli/install/templates/cookbooks/main/libraries/run_for_app.rb', line 3

def run_for_app(*apps, &block)
  apps.map! {|a| a.to_s }
  node[:applications].map{|k,v| [k,v] }.sort_by {|a,b| a }.each do |name, app_data|
    if apps.include?(name)
      block.call(name, app_data)
    end
  end
end