Skip to content

Instantly share code, notes, and snippets.

@brandocorp
Created January 22, 2015 18:39
Show Gist options
  • Save brandocorp/3084c5b7f1a7ef5cd29f to your computer and use it in GitHub Desktop.
Save brandocorp/3084c5b7f1a7ef5cd29f to your computer and use it in GitHub Desktop.
Stop include_recipe directive from actually loading the recipe
# This keeps any cookbook aside from our target cookbook from actually loading recipes
class Chef
class CookbookVersion
alias_method :old_load_recipe, :load_recipe
def load_recipe(recipe_name, run_context)
old_load_recipe(recipe_name, run_context) if metadata.name == 'cookbook_name'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment