Class: Polyrun::Coverage::Formatter::HtmlFormatter

Inherits:
Base
  • Object
show all
Defined in:
lib/polyrun/coverage/formatter.rb

Instance Method Summary collapse

Methods inherited from Base

#format, #initialize

Constructor Details

This class inherits a constructor from Polyrun::Coverage::Formatter::Base

Instance Method Details

#write_files(result, output_dir, basename) ⇒ Object



110
111
112
113
114
115
116
# File 'lib/polyrun/coverage/formatter.rb', line 110

def write_files(result, output_dir, basename)
  path = File.join(output_dir, "#{basename}.html")
  title = (result.meta && result.meta["title"]) || (result.meta && result.meta[:title]) || "Polyrun coverage"
  root = result.meta && (result.meta["polyrun_coverage_root"] || result.meta[:polyrun_coverage_root])
  File.write(path, Merge.emit_html(result.coverage_blob, title: title, root: root, groups: result.groups))
  {html: path}
end