lib/fdlcap/extensions/recipe_definition.rb in factorylabs-fdlcap-0.2.7 vs lib/fdlcap/extensions/recipe_definition.rb in factorylabs-fdlcap-0.3.0

- old
+ new

@@ -5,10 +5,15 @@ def define_recipe(name,&block) recipes = fetch(:fdlcap_recipes) recipes[name] = block end - def use_recipe(recipe) - fetch(:fdlcap_recipes)[recipe].call + def use_recipe(recipe, *args) + recipe_block = fetch(:fdlcap_recipes)[recipe] + if recipe_block + recipe_block.call(*args) + else + raise ArgumentError, "Recipe => :#{recipe} not found" + end end end \ No newline at end of file