# File lib/htmldoc.rb, line 148
    def generate
      tempfile = nil
      unless @options[:outdir] || @options[:outfile]
        tempfile = Tempfile.new("htmldoc.temp")
        @options[:outfile] = tempfile.path
      end
      execute
      if @result[:bytes]
        if tempfile
          File.open(tempfile.path, "rb") { |f| f.read }
        else
          true
        end
      else
        false
      end
    ensure
      if tempfile
        tempfile.close
        @options[:outfile] = nil
      end
      @tempfiles.each { |t| t.close }
    end