Skip to content

Instantly share code, notes, and snippets.

@jashmenn
Created May 14, 2009 20:15
Show Gist options
  • Save jashmenn/111874 to your computer and use it in GitHub Desktop.
Save jashmenn/111874 to your computer and use it in GitHub Desktop.
def require_chef_recipe
unless @required_chef_recipe
include_chef_recipe "god" # requires opscode chef recipes
@required_chef_recipe = true
end
end
# wish it could be
def require_chef_recipe
do_once do
include_chef_recipe "god" # requires opscode chef recipes
end
end
# example
def require_chef_recipe
do_once do
puts "hi"
end
end
require_chef_recipe # => "hi"
require_chef_recipe # => nothing happens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment