Sha256: 4789abe220e207bc2c36520ec929fe52504bc6d3069b093d1a95b23d2f8106e4

Contents?: true

Size: 867 Bytes

Versions: 2

Compression:

Stored size: 867 Bytes

Contents

module Sprinkle
  module Installers
    # = Thor Installer
    #
    # This installer runs a thor task.
    # 
    # == 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 do
    #     thor 'spec', :file => "/var/setup/Thorfile"
    #   end
    class Thor < Sprinkle::Installers::Rake
      
      api do
        def thor(task, options = {}, &block)
          install Thor.new(self, task, options, &block)
        end  
      end
      
      protected

      def executable #:nodoc:
        "thor"
      end
      
      def taskfile #:nodoc:
        file = @options[:thorfile] || @options[:file] 
        file ? "-f #{file} " : ""
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sprinkle-0.7.7 lib/sprinkle/installers/thor.rb
sprinkle-0.7.6.2 lib/sprinkle/installers/thor.rb