Permalink
Browse files

minor: adding file check to gem signing

  • Loading branch information...
brandonblack committed Apr 10, 2013
1 parent 8d52a17 commit 4746ddfffeb383109342f75bbb13d09a6029b657
Showing with 18 additions and 6 deletions.
  1. +6 −2 bson.gemspec
  2. +6 −2 bson_ext.gemspec
  3. +6 −2 mongo.gemspec
View
@@ -10,8 +10,12 @@ Gem::Specification.new do |s|
s.rubyforge_project = 'bson'
s.license = 'Apache License Version 2.0'
- s.signing_key = 'gem-private_key.pem'
- s.cert_chain = ['gem-public_cert.pem']
+ if File.exists?('gem-private_key.pem')
+ s.signing_key = 'gem-private_key.pem'
+ s.cert_chain = ['gem-public_cert.pem']
+ else
+ warn 'Warning: No private key present, creating unsigned gem.'
+ end
s.files = ['bson.gemspec', 'LICENSE', 'VERSION']
s.files += ['bin/b2json', 'bin/j2bson', 'lib/bson.rb']
View
@@ -11,8 +11,12 @@ Gem::Specification.new do |s|
s.rubyforge_project = 'bson_ext'
s.license = 'Apache License Version 2.0'
- s.signing_key = 'gem-private_key.pem'
- s.cert_chain = ['gem-public_cert.pem']
+ if File.exists?('gem-private_key.pem')
+ s.signing_key = 'gem-private_key.pem'
+ s.cert_chain = ['gem-public_cert.pem']
+ else
+ warn 'Warning: No private key present, creating unsigned gem.'
+ end
s.files = ['bson_ext.gemspec', 'LICENSE', 'VERSION']
s.files += Dir['ext/**/*.rb'] + Dir['ext/**/*.c'] + Dir['ext/**/*.h']
View
@@ -11,8 +11,12 @@ Gem::Specification.new do |s|
s.rubyforge_project = 'mongo'
s.license = 'Apache License Version 2.0'
- s.signing_key = 'gem-private_key.pem'
- s.cert_chain = ['gem-public_cert.pem']
+ if File.exists?('gem-private_key.pem')
+ s.signing_key = 'gem-private_key.pem'
+ s.cert_chain = ['gem-public_cert.pem']
+ else
+ warn 'Warning: No private key present, creating unsigned gem.'
+ end
s.files = ['mongo.gemspec', 'LICENSE', 'VERSION']
s.files += ['README.md', 'Rakefile', 'bin/mongo_console']

0 comments on commit 4746ddf

Please sign in to comment.