    # File lib/rubygems/server.rb, line 336
      def initialize(gem_dir, port, daemon)
        Socket.do_not_reverse_lookup = true

        @gem_dir = gem_dir
        @port = port
        @daemon = daemon
        logger = WEBrick::Log.new nil, WEBrick::BasicLog::FATAL
        @server = WEBrick::HTTPServer.new :DoNotListen => true, :Logger => logger

        @spec_dir = File.join @gem_dir, 'specifications'

        unless File.directory? @spec_dir then
          raise ArgumentError, "#{@gem_dir} does not appear to be a gem repository"
        end

        @source_index = Gem::SourceIndex.from_gems_in @spec_dir
      end