In Files

  • rubygems/source/local.rb

Parent

Methods

Class/Module Index [+]

Quicksearch

Gem::Source::Local

The local source finds gems in the current directory for fulfilling dependencies.

Public Instance Methods

<=>(other) click to toggle source

Local sorts before Gem::Source and after Gem::Source::Installed

 
               # File rubygems/source/local.rb, line 18
def <=>(other)
  case other
  when Gem::Source::Installed,
       Gem::Source::Lock then
    -1
  when Gem::Source::Local then
    0
  when Gem::Source then
    1
  else
    nil
  end
end
            
find_gem(gem_name, version = Gem::Requirement.default, prerelease = false) click to toggle source
 
               # File 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