Sha256: c32426798e15583709255aa47fde971025c99e1f02f975d51218c7512283c718

Contents?: true

Size: 703 Bytes

Versions: 8

Compression:

Stored size: 703 Bytes

Contents

module Sprinkle
  module Deployment
    def deployment(&block)
      @deployment = Deployment.new(&block)
    end

    class Deployment
      attr_accessor :style, :defaults

      def initialize(&block)
        @defaults = {}
        self.instance_eval(&block)
        raise 'No delivery mechanism defined' unless @style
      end

      def delivery(type, &block)
        @style = Actors.const_get(type.to_s.titleize).new &block
      end

      def method_missing(sym, *args, &block)
        @defaults[sym] = block
      end

      def respond_to?(sym); !!@defaults[sym]; end

      def process
        POLICIES.each do |policy|
          policy.process(self)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
auser-sprinkle-0.1.5 lib/sprinkle/deployment.rb
crafterm-sprinkle-0.1.0 lib/sprinkle/deployment.rb
crafterm-sprinkle-0.1.1 lib/sprinkle/deployment.rb
crafterm-sprinkle-0.1.2 lib/sprinkle/deployment.rb
crafterm-sprinkle-0.1.4 lib/sprinkle/deployment.rb
crafterm-sprinkle-0.1.5 lib/sprinkle/deployment.rb
sprinkle-0.1.5 lib/sprinkle/deployment.rb
sprinkle-0.1.4 lib/sprinkle/deployment.rb