Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Setup gem signing.

  • Loading branch information...
commit 13372d693fdac6d73f7c671bc0433ad9f5de541d 1 parent 3dc4927
@myronmarston myronmarston authored
Showing with 15 additions and 0 deletions.
  1. +9 −0 Rakefile
  2. +6 −0 rspec.gemspec
View
9 Rakefile
@@ -14,3 +14,12 @@ task :default do
puts "Nothing to do for the default task"
end
+task :verify_private_key_present do
+ private_key = File.expand_path('~/.gem/rspec-gem-private_key.pem')
+ unless File.exists?(private_key)
+ raise "Your private key is not present. This gem should not be built without that."
+ end
+end
+
+task :build => :verify_private_key_present
+
View
6 rspec.gemspec
@@ -24,6 +24,12 @@ Gem::Specification.new do |s|
s.rdoc_options = ["--charset=UTF-8"]
s.require_path = "lib"
+ private_key = File.expand_path('~/.gem/rspec-gem-private_key.pem')
+ if File.exists?(private_key)
+ s.signing_key = private_key
+ s.cert_chain = [File.expand_path('~/.gem/rspec-gem-public_cert.pem')]
+ end
+
%w[core expectations mocks].each do |name|
if RSpec::Version::STRING =~ /[a-zA-Z]+/
s.add_runtime_dependency "rspec-#{name}", "= #{RSpec::Version::STRING}"
Please sign in to comment.
Something went wrong with that request. Please try again.