Created
October 13, 2016 01:22
-
-
Save grempe/f2a9822578d46c0545b614ced20d5695 to your computer and use it in GitHub Desktop.
A script to generate a Ruby gem signing certificate of N years length. Temporary workaround until this is built into Rubygems.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Usage: | |
# ./gen_long_expire_gem_cert.rb [email protected] [years] | |
# See also: | |
# https://github.com/rubygems/rubygems/pull/1725 | |
# https://github.com/djberg96/sys-uname/issues/5 | |
require 'rubygems' | |
require 'rubygems/security' | |
require 'rubygems/commands/cert_command' | |
# change the constant to equal 10 years | |
years = ARGV[1].nil? ? 10 : ARGV[1].to_i | |
Gem::Security::ONE_YEAR = 31536000 * years | |
puts "Building a #{years} year cert..." | |
c = Gem::Commands::CertCommand.new | |
c.build ARGV[0].to_s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment