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:

  • The system cache is prefered if it is writable or can be created.
  • The user cache is used otherwise

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.

Methods

Included Modules

Gem::UserInteraction

Public Class methods

Search all source indexes for pattern.

Public Instance methods

The most recent cache data.

The name of the cache file to be read

Write the cache to a local file (if it is dirty).

Refreshes each source in the cache from its repository.

Searches all source indexes for pattern.

Set the source info cache data directly. This is mainly used for unit testing when we don‘t want to read a file system for to grab the cached source index information. The hash should map a source URL into a SourceIndexCacheEntry.

The name of the system cache file.

Mark the cache as updated (i.e. dirty).

The name of the user cache file.

Write data to the proper cache.

[Validate]