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
fdlcap-0.3.35 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.3.34 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.3.33 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.3.31 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.3.30 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.3.29 lib/fdlcap/extensions/recipe_definition.rb
fdlcap-0.3.28 lib/fdlcap/extensions/recipe_definition.rb