Class: Chef::Recipe

Inherits:
Object
  • Object
show all
Defined in:
lib/engineyard-recipes/generators/templates/cookbooks/main/libraries/run_for_app.rb,
lib/engineyard-recipes/generators/init_resin_chef_generator/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-recipes/generators/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