Steps to Create a Signed Amortization Gem
Step 1. To Create Self-Signed Gem Certgem cert --build andrew@email.comExpected Result:
Public Cert: gem-public_cert.pem
Private Key: gem-private_key.pem
Step 2. To Put Gem Certs in Proper Locations
mv gem-private_key.pem /my_private_keys
mv gem-public_cert.pem /my_public_keys
Step 3. To Create Folder Structure
touch amortization.gemspec
mkdir lib
touch lib/amortization.rb
Step 4. To Create lib/amortization.rb
class Amortization
def self.value
'123456789'
end
end
Step 5. To Create amortization.gemspec
Gem::Specification.new do |s|
s.name = 'amortization'
s.version = '1.0.0'
s.date = '2014-05-13'
s.summary = 'To provide insurance of integrity of my application'
s.description = 'This is an application to calculate mortgage amortization'
s.authors = ['Andrew Leung']
s.email = 'andrew@email.com'
s.files = ['lib/amortization.rb']
s.license = 'MIT'
s.cert_chain = ['certs/gem-public_cert.pem']
s.signing_key = File.expand_path('~/.ssh/gem-private_key.pem') if $0 =~ /gem\z/
end
Step 6. To Build Signed Gem
gem build amortization.gemspecExpected Result:
Successfully built RubyGem
Name: encode
Version: 1.0.0
File: amortization-1.0.0.gem
Steps to Install a Signed Amortization Gem
Step 1. To Obtain Public Gem Cert on Target PlatformStep 2. To Add Public Gem Cert to Approved List
gem cert --add gem-public_cert.pemExpected Result:
Added '/CN=andrew/DC=email/DC=com'
Step 3. To Install Signed Gem
gem install amortization-1.0.0.gemExpected Result:
Successfully installed amortization-1.0.0
1 gem installed
Installing ri documentation for amortization-1.0.0...
Installing RDoc documentation for amortization-1.0.0...
No comments:
Post a Comment