Class: SimpleCov::Formatter::HTMLFormatter

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

Constant Summary collapse

VERSION =
"0.8.0"

Instance Method Summary collapse

Instance Method Details

#format(result) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/simplecov-html.rb', line 13

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"), "w+") do |file|
    file.puts template('layout').result(binding)
  end
  puts output_message(result)
end

#output_message(result) ⇒ Object



24
25
26
# File 'lib/simplecov-html.rb', line 24

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