Sha256: ee67148ef1b2b5b5dc79d1d52c6bb74d555ed046ee112344ddc8794297bfca46

Contents?: true

Size: 415 Bytes

Versions: 47

Compression:

Stored size: 415 Bytes

Contents

Capistrano::Configuration.instance(:must_exist).load do
  
  set :fdlcap_recipes, {}
  
  def define_recipe(name,&block)
    recipes = fetch(:fdlcap_recipes)
    recipes[name] = block
  end
  
  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

Version data entries

47 entries across 47 versions & 2 rubygems

Version Path
factorylabs-fdlcap-0.3.0 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.1 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.10 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.11 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.15 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.16 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.17 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.18 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.19 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.2 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.20 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.21 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.23 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.24 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.25 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.26 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.27 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.28 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.3 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.4 lib/fdlcap/extensions/recipe_definition.rb