Class | Gem::SourceInfoCache |
In: |
lib/rubygems/source_info_cache.rb
|
Parent: | Object |
SourceInfoCache stores a copy of the gem index for each gem source.
There are two possible cache locations, the system cache and the user cache:
Once a cache is selected, it will be used for all operations. SourceInfoCache will not switch between cache files dynamically.
Cache data is a Hash mapping a source URI to a SourceInfoCacheEntry.
The singleton Gem::SourceInfoCache. If all is true, a full refresh will be performed if the singleton instance is being initialized.
Search all source indexes returning the source_uri. See Gem::SourceInfoCache#search_with_source.
Refreshes each source in the cache from its repository. If all is false, only latest gems are updated.
Searches all source indexes. See Gem::SourceIndex#search for details on pattern and platform_only. If all is set to true, the full index will be loaded before searching.
Searches all source indexes for pattern. If only_platform is true, only gems matching Gem.platforms will be selected. Returns an Array of pairs containing the Gem::Specification found and the source_uri it was found at.
Set the source info cache data directly. This is mainly used for unit testing when we don‘t want to read a file system to grab the cached source index information. The hash should map a source URL into a SourceInfoCacheEntry.
Determine if path is a candidate for a cache file. Returns path if it is, nil if not.