method

find_gem

Importance_0
Ruby latest stable (v2_5_5) - 0 notes - Class: Local
find_gem(gem_name, version = Gem::Requirement.default, prerelease = false) public

No documentation

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

Hide source
# File lib/rubygems/source/local.rb, line 81
  def find_gem gem_name, version = Gem::Requirement.default, # :nodoc:
               prerelease = false
    load_specs :complete

    found = []

    @specs.each do |n, data|
      if n.name == gem_name
        s = data[1].spec

        if version.satisfied_by?(s.version)
          if prerelease
            found << s
          elsif !s.version.prerelease? || version.prerelease?
            found << s
          end
        end
      end
    end

    found.max_by { |s| s.version }
  end
Register or log in to add new notes.