Method: Chef::CookbookVersion#load_ruby_recipe

Defined in:
lib/chef/cookbook_version.rb

#load_ruby_recipe(recipe_name, run_context) ⇒ Object



253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/chef/cookbook_version.rb', line 253

def load_ruby_recipe(recipe_name, run_context)
  Chef::Log.trace("Found recipe #{recipe_name} in cookbook #{name}")
  recipe = Chef::Recipe.new(name, recipe_name, run_context)
  recipe_filename = recipe_filenames_by_name[recipe_name]

  unless recipe_filename
    raise Chef::Exceptions::RecipeNotFound, "could not find #{recipe_name} files for cookbook #{name}"
  end

  recipe.from_file(recipe_filename)
  recipe
end