def write_report(filename)
      extension = File.extname(filename)
      report = yield(extension)
      File.open(filename, "wb") do |file|
        file.write(report)
      end
    end
def write_report(filename)
      extension = File.extname(filename)
      report = yield(extension)
      File.open(filename, "wb") do |file|
        file.write(report)
      end
    end
---------
 :section: Write report to file