Sha256: 90fbfdd20e0d2af17971f8609b2a757b98c44425702f02fe584e03c389a0f62d

Contents?: true

Size: 637 Bytes

Versions: 5

Compression:

Stored size: 637 Bytes

Contents

module Sprinkle
  module Actors
    class Vlad
      require 'vlad'
      attr_accessor :loaded_recipes

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

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

      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

      private

        def task_sym(name)
          "install_#{name.to_task_name}".to_sym
        end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
crafterm-sprinkle-0.1.2 lib/sprinkle/actors/vlad.rb
crafterm-sprinkle-0.1.4 lib/sprinkle/actors/vlad.rb
crafterm-sprinkle-0.1.5 lib/sprinkle/actors/vlad.rb
sprinkle-0.1.5 lib/sprinkle/actors/vlad.rb
sprinkle-0.1.4 lib/sprinkle/actors/vlad.rb