Class: Gem::Commands::SignCommand
- Inherits:
-
Gem::Command
- Object
- Gem::Command
- Gem::Commands::SignCommand
- Includes:
- VersionOption
- Defined in:
- lib/rubygems/commands/sign_command.rb
Overview
CLI interface to the internal signing code:
gem sign gemname-0.0.0.gem
gem sign -key 0xDEADBEEF gemname-0.0.0.gem
Instance Method Summary collapse
-
#arguments ⇒ Object
:nodoc:.
-
#defaults_str ⇒ Object
:nodoc:.
-
#execute ⇒ Object
:nodoc:.
-
#initialize ⇒ SignCommand
constructor
:nodoc:.
-
#usage ⇒ Object
:nodoc:.
Constructor Details
#initialize ⇒ SignCommand
:nodoc:
16 17 18 19 20 21 22 23 24 |
# File 'lib/rubygems/commands/sign_command.rb', line 16 def initialize # :nodoc: super 'sign', 'Signs an existing gem with your OpenPGP key. This allows third parties to verify the key later via the \'gem verify\' command.', :key => nil add_version_option add_option('--key KEY', "Specify key id if you don't want to use your default gpg key") do |key, | [:key] = key end end |
Instance Method Details
#arguments ⇒ Object
:nodoc:
26 27 28 |
# File 'lib/rubygems/commands/sign_command.rb', line 26 def arguments # :nodoc: "GEMNAME name of gem to sign" end |
#defaults_str ⇒ Object
:nodoc:
30 31 32 |
# File 'lib/rubygems/commands/sign_command.rb', line 30 def defaults_str # :nodoc: "" end |
#execute ⇒ Object
:nodoc:
38 39 40 41 42 |
# File 'lib/rubygems/commands/sign_command.rb', line 38 def execute # :nodoc: version = [:version] || Gem::Requirement.default gem, specs = get_one_gem_name, [] Gem::OpenPGP.sign_gem gem, key=[:key] end |
#usage ⇒ Object
:nodoc:
34 35 36 |
# File 'lib/rubygems/commands/sign_command.rb', line 34 def usage # :nodoc: "gem sign GEMNAME" end |