Sha256: 78f4f8069c454662772e76239e4cfaa3b5377cfab6586dd9b47fe7a45e86a520

Contents?: true

Size: 703 Bytes

Versions: 5

Compression:

Stored size: 703 Bytes

Contents

module Sprinkle
  # = Scripting
  #
  # Script gives you a way to programatically run a given
  # sprinkle script. 
  class Script
    include Sprinkle::Deployment

    def initialize
      @deployment = nil
    end

    # 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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sprinkle-0.7.7 lib/sprinkle/script.rb
sprinkle-0.7.6.2 lib/sprinkle/script.rb
sprinkle-0.7.6.1 lib/sprinkle/script.rb
sprinkle-0.7.6 lib/sprinkle/script.rb
sprinkle-0.7.5 lib/sprinkle/script.rb