Class: SimpleCov::Formatter::HTMLFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/simplecov-html.rb,
lib/simplecov-html/version.rb

Constant Summary collapse

VERSION =
"0.10.2".freeze

Instance Method Summary collapse

Instance Method Details

#format(result) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/simplecov-html.rb', line 17

def format(result)
  Dir[File.join(File.dirname(__FILE__), "../public/*")].each do |path|
    FileUtils.cp_r(path, asset_output_path)
  end

  File.open(File.join(output_path, "index.html"), "wb") do |file|
    file.puts template("layout").result(binding)
  end
  puts output_message(result)
end

#output_message(result) ⇒ Object



28
29
30
# File 'lib/simplecov-html.rb', line 28

def output_message(result)
  "Coverage report generated for #{result.command_name} to #{output_path}. #{result.covered_lines} / #{result.total_lines} LOC (#{result.covered_percent.round(2)}%) covered."
end