Flowdock
method

to_spec

Importance_0
Ruby latest stable (v2_5_5) - 0 notes - Class: Dependency
to_spec() public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rubygems/dependency.rb, line 321
  def to_spec
    matches = self.to_specs.compact

    active = matches.find { |spec| spec.activated? }
    return active if active

    return matches.first if prerelease?

    # Move prereleases to the end of the list for >= 0 requirements
    pre, matches = matches.partition { |spec| spec.version.prerelease? }
    matches += pre if requirement == Gem::Requirement.default

    matches.first
  end
Register or log in to add new notes.