execute (Gem::Commands::GenerateIndexCommand)

    # File lib/rubygems/commands/generate_index_command.rb, line 111
      def execute
        if options[:update] and
           (options[:rss_host] or options[:rss_gems_host]) then
          alert_error '--update not compatible with RSS generation'
          terminate_interaction 1
        end

        if not File.exist?(options[:directory]) or
           not File.directory?(options[:directory]) then
          alert_error "unknown directory name #{directory}."
          terminate_interaction 1
        else
          indexer = Gem::Indexer.new options.delete(:directory), options

          if options[:update] then
            indexer.update_index
          else
            indexer.generate_index
          end
        end
      end