Preview Ruby 4.1 is a preview. It can change before the final release. 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-4.1.0-preview1/lib/rubygems/specification_record.rb, line 186
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
#find_unloaded_by_path
also in
4.0 · 3.4