def document generator, options, destination
    options = options.dup
    options.exclude ||= [] # TODO maybe move to RDoc::Options#finish
    options.setup_generator generator
    options.op_dir = destination
    options.finish

    @rdoc.options = options
    @rdoc.generator = options.generator.new options

    say "Installing #{generator} documentation for #{@spec.full_name}"

    FileUtils.mkdir_p options.op_dir

    Dir.chdir options.op_dir do
      begin
        @rdoc.class.current = @rdoc
        @rdoc.generator.generate @file_info
      ensure
        @rdoc.class.current = nil
      end
    end
  end
#
Generates documentation using the named +generator+ ("darkfish" or "ri")
and following the given +options+.

Documentation will be generated into +destination+