Sha256: f8640d92f66aa3b8179212002a82ceb9793adfd4d08ebb85af571502ca472964

Contents?: true

Size: 845 Bytes

Versions: 5

Compression:

Stored size: 845 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 < 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

5 entries across 5 versions & 1 rubygems

Version Path
sprinkle-0.7.6.1 lib/sprinkle/installers/thor.rb
sprinkle-0.7.6 lib/sprinkle/installers/thor.rb
sprinkle-0.7.5 lib/sprinkle/installers/thor.rb
sprinkle-0.7.4 lib/sprinkle/installers/thor.rb
sprinkle-0.7.3 lib/sprinkle/installers/thor.rb