Sha256: b412c46deb9fd622c6dd52739cc54e512e79c41e1e9eba802ebfadf74fb7b4fc

Contents?: true

Size: 1.23 KB

Versions: 6

Compression:

Stored size: 1.23 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.
        #
        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

6 entries across 6 versions & 1 rubygems

Version Path
rubygems-tasks-0.1.2 lib/rubygems/tasks/sign/task.rb
rubygems-tasks-0.1.1 lib/rubygems/tasks/sign/task.rb
rubygems-tasks-0.1.0 lib/rubygems/tasks/sign/task.rb
rubygems-tasks-0.1.0.pre3 lib/rubygems/tasks/sign/task.rb
rubygems-tasks-0.1.0.pre2 lib/rubygems/tasks/sign/task.rb
rubygems-tasks-0.1.0.pre1 lib/rubygems/tasks/sign/task.rb