Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
Setup gem signing.
Browse files Browse the repository at this point in the history
  • Loading branch information
myronmarston committed Nov 8, 2013
1 parent 3dc4927 commit 13372d6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

6 changes: 6 additions & 0 deletions rspec.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 13372d6

Please sign in to comment.