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'.freeze
- GEM_HOMEPAGES =
%w[source_code_uri homepage_uri].freeze
Instance Attribute Summary collapse
-
#gem_name ⇒ Object
readonly
Returns the value of attribute gem_name.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(gem_name, source) ⇒ RubyGemsFetcher
constructor
A new instance of RubyGemsFetcher.
-
#source_uri ⇒ String|nil
Finds where code is hosted.
Constructor Details
#initialize(gem_name, source) ⇒ RubyGemsFetcher
Returns a new instance of RubyGemsFetcher.
16 17 18 19 |
# File 'lib/gem_updater/ruby_gems_fetcher.rb', line 16 def initialize(gem_name, source) @gem_name = gem_name @source = source end |
Instance Attribute Details
#gem_name ⇒ Object (readonly)
Returns the value of attribute gem_name.
12 13 14 |
# File 'lib/gem_updater/ruby_gems_fetcher.rb', line 12 def gem_name @gem_name end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
12 13 14 |
# File 'lib/gem_updater/ruby_gems_fetcher.rb', line 12 def source @source end |
Instance Method Details
#source_uri ⇒ String|nil
Finds where code is hosted. Most likely in will be on rubygems, else look in other sources.
25 26 27 |
# File 'lib/gem_updater/ruby_gems_fetcher.rb', line 25 def source_uri uri_from_rubygems || uri_from_other_sources end |