- A
- D
- E
- F
- L
- N
- R
- S
Class Public methods
dirs_from(paths) Link
from_path(path) Link
new(dirs) Link
Instance Public methods
add_spec(spec) Link
Adds spec
to the the record, keeping the collection properly sorted.
all() Link
Returns the list of all specifications in the record
all=(specs) Link
Sets the specs known by the record to specs
.
all_names() Link
Return full names of all specs in the record in sorted order.
each() Link
Enumerate every known spec.
find_active_stub_by_path(path) Link
Return the best specification in the record that contains the file matching path
, among those already activated.
find_all_by_name(name, *requirements) Link
Returns every spec in the record that matches name
and optional requirements
.
# File ruby/lib/rubygems/specification_record.rb, line 130 def find_all_by_name(name, *requirements) req = Gem::Requirement.create(*requirements) env_req = Gem.env_requirement(name) matches = stubs_for(name).find_all do |spec| req.satisfied_by?(spec.version) && env_req.satisfied_by?(spec.version) end.map(&:to_spec) if name == "bundler" && !req.specific? require_relative "bundler_version_finder" Gem::BundlerVersionFinder.prioritize!(matches) end matches end
find_by_path(path) Link
Return the best specification in the record that contains the file matching path
.
find_inactive_by_path(path) Link
Return the best specification in the record that contains the file matching path
amongst the specs that are not activated.
latest_spec_for(name) Link
Return the latest installed spec in the record for gem name
.
latest_specs(prerelease) Link
Return the latest specs in the record, optionally including prerelease specs if prerelease
is true.
remove_spec(spec) Link
Removes spec
from the record.
stubs() Link
Returns a Gem::StubSpecification
for every specification in the record
stubs_for(name) Link
Returns a Gem::StubSpecification
for every specification in the record named name
only returns stubs that match Gem.platforms
stubs_for_pattern(pattern, match_platform = true) Link
Finds stub specifications matching a pattern in the record, optionally filtering out specs not matching the current platform
# File ruby/lib/rubygems/specification_record.rb, line 67 def stubs_for_pattern(pattern, match_platform = true) installed_stubs = installed_stubs(pattern) installed_stubs.select! {|s| Gem::Platform.match_spec? s } if match_platform stubs = installed_stubs + Gem::Specification.default_stubs(pattern) stubs = stubs.uniq(&:full_name) Gem::Specification._resort!(stubs) stubs end