    # File lib/rubygems/indexer.rb, line 33
      def initialize(directory)
        unless ''.respond_to? :to_xs then
          fail "Gem::Indexer requires that the XML Builder library be installed:" \
               "\n\tgem install builder"
        end

        @dest_directory = directory
        @directory = File.join Dir.tmpdir, "gem_generate_index_#{$$}"

        marshal_name = "Marshal.#{Gem.marshal_version}"

        @master_index = File.join @directory, 'yaml'
        @marshal_index = File.join @directory, marshal_name

        @quick_dir = File.join @directory, 'quick'

        @quick_marshal_dir = File.join @quick_dir, marshal_name

        @quick_index = File.join @quick_dir, 'index'
        @latest_index = File.join @quick_dir, 'latest_index'

        @specs_index = File.join @directory, "specs.#{Gem.marshal_version}"
        @latest_specs_index = File.join @directory,
                                        "latest_specs.#{Gem.marshal_version}"

        files = [
          @specs_index,
          "#{@specs_index}.gz",
          @latest_specs_index,
          "#{@latest_specs_index}.gz",
          @quick_dir,
          @master_index,
          "#{@master_index}.Z",
          @marshal_index,
          "#{@marshal_index}.Z",
        ]

        @files = files.map do |path|
          path.sub @directory, ''
        end
      end