Class: Prepp::Recipe

Inherits:
Object show all
Defined in:
lib/prepp/recipe.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Recipe

Returns a new instance of Recipe.



6
7
8
9
10
11
12
# File 'lib/prepp/recipe.rb', line 6

def initialize(&block)
  @commands = []
  @targets = []

  instance_eval(&block)
  execute
end

Instance Method Details

#package(name, *dependencies, &block) ⇒ Object



14
15
16
# File 'lib/prepp/recipe.rb', line 14

def package(name, *dependencies, &block)
  @commands << Command.new(name, *dependencies, &block)
end

#target(host, user, options = {}) ⇒ Object



18
19
20
# File 'lib/prepp/recipe.rb', line 18

def target(host, user, options={})
  @targets << Target.new(host, user, options)
end