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.5 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.6 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.7 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.8 lib/fdlcap/extensions/recipe_definition.rb
factorylabs-fdlcap-0.3.9 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.4.17 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.4.15 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.4.14 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.4.13 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.4.12 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.4.11 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.4.10 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.4.9 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.4.7 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.4.6 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.4.5 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.4.4 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.4.3 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.4.2 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.4.0 lib/fdlcap/extensions/recipe_definition.rb