    # File lib/rubygems/commands/outdated_command.rb, line 18
      def execute
        locals = Gem::SourceIndex.from_installed_gems

        locals.outdated.sort.each do |name|
          local = locals.search(/^#{name}$/).last

          dep = Gem::Dependency.new local.name, ">= #{local.version}"
          remotes = Gem::SpecFetcher.fetcher.fetch dep
          remote = remotes.last.first

          say "#{local.name} (#{local.version} < #{remote.version})"
        end
      end