Method: Gem::Specification.find_by_name

Defined in:
lib/rubygems/specification.rb

.find_by_name(name, *requirements) ⇒ Object

Find the best specification matching a name and requirements. Raises if the dependency doesn’t resolve to a valid specification.



1014
1015
1016
1017
1018
1019
1020
# File 'lib/rubygems/specification.rb', line 1014

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