Module: Kicker::Recipes

Defined in:
lib/kicker/recipes.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.recipe(name, &block) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/kicker/recipes.rb', line 36

def recipe(name, &block)
  name = name.to_sym
  if block_given?
    recipes[name] = block
  else
    if recipe = recipes[name]
      recipe.call
    else
      raise LoadError, "Recipe `#{name}' does not exist."
    end
  end
end

.recipe_filesObject



49
50
51
# File 'lib/kicker/recipes.rb', line 49

def recipe_files
  Dir.glob(File.join(RECIPES_DIR, '*.rb')) + Dir.glob(File.join(USER_RECIPES_DIR, '*.rb'))
end

.recipesObject



32
33
34
# File 'lib/kicker/recipes.rb', line 32

def recipes
  @recipes ||= {}
end