Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
Gem::Specification.find_by_name
find_by_name(name, *requirements)
lib/rubygems/specification.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/rubygems/specification.rb, line 1022
def self.find_by_name(name, *requirements)
requirements = Gem::Requirement.default if requirements.empty?
# TODO: maybe try: find { |s| spec === dep }
Gem::Dependency.new(name, *requirements).to_spec
end
Find the best specification matching a name and requirements. Raises if the dependency doesn’t resolve to a valid specification.
See also
.find_by_full_name
.find_by_path
.find_all_by_name
.find_inactive_by_path
also in
4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0