Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Gem::SpecificationRecord#find_unloaded_by_path
find_unloaded_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 200
def find_unloaded_by_path(path)
stub = stubs.find do |s|
next if Gem.loaded_specs[s.name]
s.contains_requirable_file? path
end
stub&.to_spec
end
Return the best specification that contains the file matching path amongst the specs that are not loaded. This method is different than find_inactive_by_path as it will filter out loaded specs by their name.