Class: Pod::Command::GemIndexCache
- Inherits:
-
Object
- Object
- Pod::Command::GemIndexCache
- Defined in:
- lib/pod/command/gem_index_cache.rb
Overview
This class is used by Command::GemsHelper to download the Gem Specification index from rubygems.org and provide info about the index.
Instance Method Summary collapse
-
#specs ⇒ Hash
(also: #download_and_cache_specs)
A memoized hash of all the rubygem specs.
-
#specs_with_name(name) ⇒ Array
Get an Array of Gem::NameTuple objects that match a given spec name.
Instance Method Details
#specs ⇒ Hash Also known as: download_and_cache_specs
A memoized hash of all the rubygem specs. If it is nil, the specs will be downloaded, which will take a few seconds to download.
15 16 17 |
# File 'lib/pod/command/gem_index_cache.rb', line 15 def specs @specs ||= download_specs end |
#specs_with_name(name) ⇒ Array
Get an Array of Gem::NameTuple objects that match a given spec name.
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/pod/command/gem_index_cache.rb', line 31 def specs_with_name(name) matching_specs = @specs.select do |spec| spec[0].name == name end name_tuples = [] matching_specs.each do |(name_tuple, _)| name_tuples << name_tuple end name_tuples end |