class Chef::Recipe

Public Class Methods

new(cookbook_name, recipe_name, run_context) click to toggle source

If the cookbook depends on compat_resource, create a ChefCompat::Recipe object instead of Chef::Recipe, for the extra goodies.

Calls superclass method
# File files/lib/chef_compat/monkeypatches/chef/recipe.rb, line 7
def self.new(cookbook_name, recipe_name, run_context)
  if run_context &&
    cookbook_name &&
    recipe_name &&
    run_context.cookbook_collection &&
    run_context.cookbook_collection[cookbook_name] &&
    run_context.cookbook_collection[cookbook_name].metadata.dependencies.has_key?('compat_resource') &&
     self != ::ChefCompat::Recipe
    ::ChefCompat::Recipe.new(cookbook_name, recipe_name, run_context)
  else
    super
  end
end