Class | Gem::SourceIndex |
In: |
lib/rubygems/source_index.rb
|
Parent: | Object |
The SourceIndex object indexes all the gems available from a particular source (e.g. a list of gem directories, or a remote source). A SourceIndex maps a gem full name to a gem specification.
NOTE: | The class used to be named Cache, but that became confusing when cached source fetchers where introduced. The constant Gem::Cache is an alias for this class to allow old YAMLized source index objects to load properly. |
Creates a new SourceIndex from the ruby format gem specifications in spec_dirs.
Factory method to construct a source index instance for a given path.
deprecated: | If supplied, from_installed_gems will act just like from_gems_in. This argument is deprecated and is provided just for backwards compatibility, and should not generally be used. |
return: | SourceIndex instance |
Returns a list of directories from Gem.path that contain specifications.
Loads a ruby-format specification from file_name and returns the loaded spec.
Constructs a source index instance from the provided specifications
specifications: | [Hash] hash of [Gem name, Gem::Specification] pairs |
Returns a Hash of name => Specification of the latest versions of each gem in this index.
Replaces the gems in the source index from specifications in the installed_spec_directories,
Search for a gem by Gem::Dependency gem_pattern. If only_platform is true, only gems matching Gem::Platform.local will be returned. An Array of matching Gem::Specification objects is returned.
For backwards compatibility, a String or Regexp pattern may be passed as gem_pattern, and a Gem::Requirement for platform_only. This behavior is deprecated and will be removed.
Updates this SourceIndex from source_uri. If all is false, only the latest gems are fetched.