ruby-win32/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb
##
# Returns a list of pairs of gemspecs and source_uris that match
# Gem::Dependency +dep+ from both local (Dir.pwd) and remote (Gem.sources)
# sources.  Gems are sorted with newer gems prefered over older gems, and
# local gems prefered over remote gems.
Returns a list of pairs of gemspecs and source_uris that match
Gem::Dependency +dep+ from both local (Dir.pwd) and remote (Gem.sources)
sources.  Gems are sorted with newer gems prefered over older gems, and
local gems prefered over remote gems.
Returns a list of pairs of gemspecs and source_uris that match Gem :: Dependency + dep + from both local ( Dir . pwd ) and remote ( Gem . sources ) sources . Gems are sorted with newer gems prefered over older gems and local gems prefered over remote gems .
def find_gems_with_sources(dep)
    gems_and_sources = []
    if @domain == :both or @domain == :local then
      Dir[File.join(Dir.pwd, "#{dep.name}-[0-9]*.gem")].each do |gem_file|
        spec = Gem::Format.from_file_by_path(gem_file).spec
        gems_and_sources << [spec, gem_file] if spec.name == dep.name
      end
    end
    if @domain == :both or @domain == :remote then
      gems_and_sources.push(*Gem::SourceInfoCache.search_with_source(dep, true))
    end
    gems_and_sources.sort_by do |gem, source|
      [gem, source !~ /^http:\/\// ? 1 : 0] 
    end
  end
def find_gems_with_sources ( dep ) gems_and_sources = [ ] if @domain == :both or @domain == :local then Dir [ File . join ( Dir . pwd , "#{dep.name}-[0-9]*.gem" ) ] . each do | gem_file | spec = Gem :: Format . from_file_by_path ( gem_file ) . spec gems_and_sources << [ spec , gem_file ] if spec . name == dep . name end end if @domain == :both or @domain == :remote then gems_and_sources . push ( * Gem :: SourceInfoCache . search_with_source ( dep , true ) ) end gems_and_sources . sort_by do | gem , source | [ gem , source !~ / ^http: \/ \/ / ? 1 : 0 ] end end
Returns a list of pairs of gemspecs and source_uris that match
Gem::Dependency +dep+ from both local (Dir.pwd) and remote (Gem.sources)
sources.
Returns a list of pairs of gemspecs and source_uris that match Gem :: Dependency + dep + from both local ( Dir . pwd ) and remote ( Gem . sources ) sources .
# local gems win
dep