Sha256: 8801957c85b7cea7f3a656cdbd2ef1df0c02d3765b289618938a3b8af83f0c24

Contents?: true

Size: 830 Bytes

Versions: 4

Compression:

Stored size: 830 Bytes

Contents

module Sprinkle
  module Installers
    # = Thor Installer
    #
    # This installer runs a thor command.
    # 
    # == Example Usage
    #
    # The following example runs the command "thor spec" on
    # the remote server.
    #
    #   package :spec do
    #     thor 'spec'
    #   end
    # 
    # Specify a Thorfile with the :thorfile option.
    #
    #   package :spec, :thorfile => "/var/setup/Thorfile" do
    #     thor 'spec'
    #   end
     
    class Thor < Installer
      def initialize(parent, commands, options = {}, &block) #:nodoc:
        super parent, options, &block
        @commands = commands
      end

      protected

        def install_commands #:nodoc:
          file = @options[:thorfile] ? "-f #{@options[:thorfile]} " : ""
          "thor #{file}#{@commands}"
        end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sprinkle-0.4.2 lib/sprinkle/installers/thor.rb
sprinkle-0.4.1 lib/sprinkle/installers/thor.rb
sprinkle-0.4.0 lib/sprinkle/installers/thor.rb
sprinkle-0.3.6 lib/sprinkle/installers/thor.rb