Class: Sprinkle::Script

Inherits:
Object show all
Includes:
Deployment
Defined in:
lib/sprinkle/script.rb

Overview

Scripting

Script gives you a way to programatically run a given sprinkle script.

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Deployment

#deployment

Constructor Details

#initializeScript

Returns a new instance of Script


9
10
11
# File 'lib/sprinkle/script.rb', line 9

def initialize
  @deployment = nil
end

Class Method Details

.sprinkle(script, filename = '__SCRIPT__') ⇒ Object

Run a given sprinkle script. This method is blocking so it will not return until the sprinkling is complete or fails. – FIXME: Improve documentation, possibly notify user how to tell if a sprinkling failed. ++


19
20
21
22
23
# File 'lib/sprinkle/script.rb', line 19

def self.sprinkle(script, filename = '__SCRIPT__')
  powder = new
  powder.instance_eval script, filename
  powder.sprinkle
end

Instance Method Details

#sprinkleObject

:nodoc:


25
26
27
# File 'lib/sprinkle/script.rb', line 25

def sprinkle #:nodoc:
  @deployment.process if @deployment
end