module TestProf::Utils::HTMLBuilder

Generates static HTML reports with injected data

Public Class Methods

generate(data:, template:, output:) click to toggle source
# File lib/test_prof/utils/html_builder.rb, line 10
def generate(data:, template:, output:)
  template = File.read(TestProf.asset_path(template))
  template.sub! "/**REPORT-DATA**/", data.to_json

  outpath = TestProf.artifact_path(output)
  File.write(outpath, template)
  outpath
end