Class: Gemsmith::Authenticators::RubyGems
- Inherits:
-
Object
- Object
- Gemsmith::Authenticators::RubyGems
- Defined in:
- lib/gemsmith/authenticators/ruby_gems.rb
Overview
An authenticator for retrieving RubyGems authorization.
Class Method Summary collapse
Instance Method Summary collapse
- #authorization ⇒ Object
-
#initialize(login, password) ⇒ RubyGems
constructor
A new instance of RubyGems.
Constructor Details
#initialize(login, password) ⇒ RubyGems
Returns a new instance of RubyGems.
14 15 16 17 18 19 |
# File 'lib/gemsmith/authenticators/ruby_gems.rb', line 14 def initialize login, password @login = login @password = password @uri = URI.parse self.class.url configure_client end |
Class Method Details
.url ⇒ Object
10 11 12 |
# File 'lib/gemsmith/authenticators/ruby_gems.rb', line 10 def self.url "https://rubygems.org/api/v1/api_key" end |
Instance Method Details
#authorization ⇒ Object
21 22 23 24 25 26 |
# File 'lib/gemsmith/authenticators/ruby_gems.rb', line 21 def request = Net::HTTP::Get.new uri.request_uri request.basic_auth login, password response = client.request request String response.body end |