         # File lib/ferret/index.rb, line 647
    647:       def ensure_writer_open()
    648:         raise "tried to use a closed index" if not @open
    649:         return if @writer
    650:         if @reader
    651:           @searcher.close if @searcher
    652:           @reader.close
    653:           @reader = nil
    654:           @searcher = nil
    655:         end
    656:         @writer = IndexWriter.new(@options)
    657:       end