Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Gem::SpecificationRecord#find_all_by_name
find_all_by_name(name, *requirements)
lib/rubygems/specification_record.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems/specification_record.rb, line 167
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
Returns every spec in the record that matches name and optional requirements.