Class: Sprinkle::Actors::Vlad

Inherits:
Object
  • Object
show all
Defined in:
lib/sprinkle/actors/vlad.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Vlad

Returns a new instance of Vlad.



7
8
9
# File 'lib/sprinkle/actors/vlad.rb', line 7

def initialize(&block)
  self.instance_eval &block if block
end

Instance Attribute Details

#loaded_recipesObject

Returns the value of attribute loaded_recipes.



5
6
7
# File 'lib/sprinkle/actors/vlad.rb', line 5

def loaded_recipes
  @loaded_recipes
end

Instance Method Details

#process(name, commands, roles) ⇒ Object



17
18
19
20
21
# File 'lib/sprinkle/actors/vlad.rb', line 17

def process(name, commands, roles)
  commands = commands.join ' && ' if commands.is_a? Array
  t = remote_task(task_sym(name), :roles => roles) { run commands }
  t.invoke
end

#script(name) ⇒ Object



11
12
13
14
15
# File 'lib/sprinkle/actors/vlad.rb', line 11

def script(name)
  @loaded_recipes ||= []
  self.load name
  @loaded_recipes << script
end