Sha256: 8d79465f2328fafea63621ab308225cdb3a81c25eb4e1abf449fdde829ce5832

Contents?: true

Size: 873 Bytes

Versions: 2

Compression:

Stored size: 873 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.
        #
        # @api semipublic
        #
        def sign(path)
          status "Signing #{File.basename(path)} ..."

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

      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubygems-tasks-0.2.2 lib/rubygems/tasks/sign/pgp.rb
rubygems-tasks-0.2.1 lib/rubygems/tasks/sign/pgp.rb