Sha256: 8f04f1999f76c7edc2b446a238da6972504f43e31b225973b6708e9e1b7f2065

Contents?: true

Size: 837 Bytes

Versions: 3

Compression:

Stored size: 837 Bytes

Contents

require 'rubygems/tasks/sign/task'

module Gem
  class Tasks
    module Sign
      #
      # The `sign:pgp` task.
      #
      class PGP < Task

        #
        # Initializes the `sign` task.
        #
        # @param [Hash] options
        #   Digest options.
        #
        def initialize(options={})
          super()

          yield self if block_given?
          define
        end

        #
        # Defines the `sign:pgp` task.
        #
        def define
          sign_task :pgp

          task :pgp => 'sign:pgp'
        end

        #
        # PGP signs a package.
        #
        # @param [String] path
        #   The path to the package.
        #
        def sign(path)
          status "Signing #{File.basename(path)} ..."

          run 'gpg', '-a', '--sign', path
        end

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubygems-tasks-0.2.0 lib/rubygems/tasks/sign/pgp.rb
rubygems-tasks-0.1.2 lib/rubygems/tasks/sign/pgp.rb
rubygems-tasks-0.1.1 lib/rubygems/tasks/sign/pgp.rb