Sha256: 38fdbb5a156360a9210a255b940c2488f99ab4b8822a1311ec58e754998af049

Contents?: true

Size: 1.26 KB

Versions: 5

Compression:

Stored size: 1.26 KB

Contents

require 'rubygems/tasks/task'

require 'digest'

module Gem
  class Tasks
    module Sign
      class Task < Tasks::Task

        #
        # Signs a package.
        #
        # @param [String] path
        #   The path to the package.
        #
        # @abstract
        #
        def sign(path)
        end

        protected

        #
        # Defines signing tasks for the various packages.
        #
        # @param [Symbol] name
        #   The name for the `sign:` task.
        #
        # @api semipublic
        #
        def sign_task(name)
          @project.builds.each do |build,packages|
            packages.each do |format,path|
              namespace :sign do
                namespace name do 
                  namespace build do
                    task format => path do
                      sign(path)
                    end
                  end
                end
              end
            end

            multi_task "sign:#{name}:#{build}", packages.keys

            task "sign:#{name}"  => "sign:#{name}:#{build}"
            task "sign:#{build}" => "sign:#{name}:#{build}"

            desc "Signs all packages" unless task?(:sign)
            task :sign           => "sign:#{name}:#{build}"
          end
        end

      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubygems-tasks-0.2.4 lib/rubygems/tasks/sign/task.rb
rubygems-tasks-0.2.3 lib/rubygems/tasks/sign/task.rb
rubygems-tasks-0.2.2 lib/rubygems/tasks/sign/task.rb
rubygems-tasks-0.2.1 lib/rubygems/tasks/sign/task.rb
rubygems-tasks-0.2.0 lib/rubygems/tasks/sign/task.rb