Class: GemOutdated::RubygemsAPI
- Inherits:
-
Object
- Object
- GemOutdated::RubygemsAPI
- Defined in:
- lib/gem_outdated/rubygems_api.rb
Constant Summary collapse
- GemNotFound =
Class.new(RuntimeError)
Instance Method Summary collapse
-
#initialize(gem_name) ⇒ RubygemsAPI
constructor
A new instance of RubygemsAPI.
- #latest_version ⇒ Object
Constructor Details
#initialize(gem_name) ⇒ RubygemsAPI
Returns a new instance of RubygemsAPI.
9 10 11 12 13 |
# File 'lib/gem_outdated/rubygems_api.rb', line 9 def initialize(gem_name) @gem_name = gem_name gem_exists? end |
Instance Method Details
#latest_version ⇒ Object
15 16 17 18 |
# File 'lib/gem_outdated/rubygems_api.rb', line 15 def latest_version endpoint = File.join(API_ENDPOINT, "versions", gem_name, "latest.json") HTTP.get(endpoint).parse["version"] end |