Class: GemUpdater::RubyGemsFetcher
- Inherits:
-
Object
- Object
- GemUpdater::RubyGemsFetcher
- Defined in:
- lib/gem_updater/ruby_gems_fetcher.rb
Overview
RubyGemsFetcher is a wrapper around rubygems API.
Constant Summary collapse
- HTTP_TOO_MANY_REQUESTS =
'429'- SLEEP_DURATION =
second
1- MAX_RETRIES =
2
Instance Attribute Summary collapse
-
#gem_name ⇒ Object
readonly
Returns the value of attribute gem_name.
Instance Method Summary collapse
-
#changelog_uri ⇒ String|nil
Finds the changelog uri.
-
#initialize(gem_name) ⇒ RubyGemsFetcher
constructor
A new instance of RubyGemsFetcher.
Constructor Details
#initialize(gem_name) ⇒ RubyGemsFetcher
Returns a new instance of RubyGemsFetcher.
17 18 19 |
# File 'lib/gem_updater/ruby_gems_fetcher.rb', line 17 def initialize(gem_name) @gem_name = gem_name end |
Instance Attribute Details
#gem_name ⇒ Object (readonly)
Returns the value of attribute gem_name.
14 15 16 |
# File 'lib/gem_updater/ruby_gems_fetcher.rb', line 14 def gem_name @gem_name end |
Instance Method Details
#changelog_uri ⇒ String|nil
Finds the changelog uri. It asks rubygems.org for changelog_uri of gem. See API: guides.rubygems.org/rubygems-org-api/#gem-methods
26 27 28 29 |
# File 'lib/gem_updater/ruby_gems_fetcher.rb', line 26 def changelog_uri response = query_rubygems response.to_h['changelog_uri'] end |