Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Gem::SpecificationRecord#find_by_path
find_by_path(path)
lib/rubygems/specification_record.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/rubygems/specification_record.rb, line 148
def find_by_path(path)
path = path.dup.freeze
spec = @spec_with_requirable_file[path] ||= stubs.find do |s|
s.contains_requirable_file? path
end || NOT_FOUND
spec.to_spec
end
Return the best specification in the record that contains the file matching path.
See also
#find_all_by_name
#find_inactive_by_path
#find_active_stub_by_path
#installed_stubs
also in
4.1 · 4.0