public
Description: Sprinkle is a software provisioning tool you can use to build remote servers with. eg. to install a Rails, or Sinatra stack on a brand new slice directly after its been created
Homepage: http://github.com/crafterm/sprinkle
Clone URL: git://github.com/crafterm/sprinkle.git
Click here to lend your support to: sprinkle and make a donation at www.pledgie.com !
sprinkle / lib / sprinkle / script.rb
100644 24 lines (22 sloc) 0.647 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module Sprinkle
  # = Programmatically Run Sprinkle
  #
  # Sprinkle::Script gives you a way to programatically run a given
  # sprinkle script.
  class Script
    # Run a given sprinkle script. This method is <b>blocking</b> 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.
    #++
    def self.sprinkle(script, filename = '__SCRIPT__')
      powder = new
      powder.instance_eval script, filename
      powder.sprinkle
    end
 
    def sprinkle #:nodoc:
      @deployment.process if @deployment
    end
  end
end