Class: Stickler::Repository::RubygemsAuthenticator
- Inherits:
-
Object
- Object
- Stickler::Repository::RubygemsAuthenticator
- Defined in:
- lib/stickler/repository/rubygems_authenticator.rb
Overview
When talking to rubygems itself, the rubygems_api key is required. This authenticator is injected automatically if the host you are talking to matches the rubygems host
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.rubygems_uri ⇒ Object
10 11 12 |
# File 'lib/stickler/repository/rubygems_authenticator.rb', line 10 def self.rubygems_uri @rubygems_uri ||= Addressable::URI.parse( "https://rubygems.org" ) end |
Instance Method Details
#credentials ⇒ Object
14 15 16 |
# File 'lib/stickler/repository/rubygems_authenticator.rb', line 14 def credentials Gem.configuration.rubygems_api_key end |
#handles?(scheme, host) ⇒ Boolean
22 23 24 25 |
# File 'lib/stickler/repository/rubygems_authenticator.rb', line 22 def handles?( scheme, host ) return ( scheme == rubygems_uri.scheme ) && ( host == rubygems_uri.host ) end |
#rubygems_uri ⇒ Object
18 19 20 |
# File 'lib/stickler/repository/rubygems_authenticator.rb', line 18 def rubygems_uri self.class.rubygems_uri end |