Permalink
Browse files

Setup gem signing.

  • Loading branch information...
1 parent d7943d1 commit b9d76f4cd43ec2e70b532b11c245035041d4443d @myronmarston myronmarston committed Nov 8, 2013
Showing with 16 additions and 0 deletions.
  1. +10 −0 Rakefile
  2. +6 −0 rspec-rails.gemspec
View
@@ -131,3 +131,13 @@ task :relish, :version do |t, args|
end
task :default => [:spec, "clobber:app", "generate:app", "generate:stuff", :smoke, :cucumber]
+
+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
@@ -21,6 +21,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
+
s.add_runtime_dependency(%q<activesupport>, [">= 3.0"])
s.add_runtime_dependency(%q<activemodel>, [">= 3.0"])
s.add_runtime_dependency(%q<actionpack>, [">= 3.0"])

0 comments on commit b9d76f4

Please sign in to comment.