diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-22 00:27:02 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-22 00:27:02 +0000 |
commit | 615ac3593499f54fde4b1eb0fba66b6bd944821b (patch) | |
tree | 1f0b0e97ee3dd51798658d53cee7eec976a83a97 /lib/rubygems/commands/cert_command.rb | |
parent | ff31b35f6a66f3c1548e3356d506ff65a574be7f (diff) | |
download | ruby-615ac3593499f54fde4b1eb0fba66b6bd944821b.tar.gz |
Merge rubygems master branch from github.com/rubygems/rubygems.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/commands/cert_command.rb')
-rw-r--r-- | lib/rubygems/commands/cert_command.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/rubygems/commands/cert_command.rb b/lib/rubygems/commands/cert_command.rb index 3f74508074..e93c39747c 100644 --- a/lib/rubygems/commands/cert_command.rb +++ b/lib/rubygems/commands/cert_command.rb @@ -149,15 +149,15 @@ class Gem::Commands::CertCommand < Gem::Command end def build_cert email, key # :nodoc: - expiration_length_days = options[:expiration_length_days] - age = - if expiration_length_days.nil? || expiration_length_days == 0 - Gem::Security::ONE_YEAR - else - Gem::Security::ONE_DAY * expiration_length_days - end + expiration_length_days = options[:expiration_length_days] || + Gem.configuration.cert_expiration_length_days + + cert = Gem::Security.create_cert_email( + email, + key, + (Gem::Security::ONE_DAY * expiration_length_days) + ) - cert = Gem::Security.create_cert_email email, key, age Gem::Security.write cert, "gem-public_cert.pem" end |