    # File lib/rubygems/spec_fetcher.rb, line 113
      def find_matching(dependency, all = false, matching_platform = true)
        found = {}

        list(all).each do |source_uri, specs|
          found[source_uri] = specs.select do |spec_name, version, spec_platform|
            dependency =~ Gem::Dependency.new(spec_name, version) and
              (not matching_platform or Gem::Platform.match(spec_platform))
          end
        end

        specs_and_sources = []

        found.each do |source_uri, specs|
          uri_str = source_uri.to_s
          specs_and_sources.push(*specs.map { |spec| [spec, uri_str] })
        end

        specs_and_sources
      end