Sha256: a5e37997bcb39edd264ac9998f33c28036f18d35604b2dbdf1bedd607334cabd

Contents?: true

Size: 979 Bytes

Versions: 3

Compression:

Stored size: 979 Bytes

Contents

module Sprinkle
  module Actors
    # = Local Delivery Method
    #
    # This actor implementation performs any given commands on your local system, as
    # opposed to other implementations that generally run commands on a remote system
    # via the network.
    #
    # This is useful if you'd like to use Sprinkle to provision your local machine. 
    # To enable this actor, in your Sprinkle script specify the :local delivery mechanism. 
    #
    #   deployment do
    #     delivery :local
    #   end
    #
    # Note, your local machine will be assumed to be a member of all roles when applying policies
    #
    class Local
      
      def process(name, commands, roles, suppress_and_return_failures = false) #:nodoc:
        commands.each do |command|
          command = "cmd.exe /c \"" + command + "\"" if RUBY_PLATFORM =~ /win32/
          system command
          return false if $?.to_i != 0
        end
        return true
      end
      
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lachlan-sprinkle-0.0.11 lib/sprinkle/actors/local.rb
lachlan-sprinkle-0.0.13 lib/sprinkle/actors/local.rb
lachlan-sprinkle-0.0.14 lib/sprinkle/actors/local.rb