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.


983
984
985
986
987
988
989
# File 'lib/rubygems/specification.rb', line 983

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