class Bundler::Finder

def search(dependency)

matching the search
[Gem::Specification]:: A collection of gem specifications
==== Returns

dependency:: The gem dependency to search for
==== Parameters

Searches for a gem that matches the dependency
def search(dependency)
  @cache[dependency.hash] ||= begin
    find_by_name(dependency.name).select do |spec|
      dependency =~ spec
    end.sort_by {|s| s.version }
  end
end