Class: SimpleCov::Formatter::HTMLFormatter
- Inherits:
-
Object
- Object
- SimpleCov::Formatter::HTMLFormatter
- Defined in:
- lib/simplecov-html.rb,
lib/simplecov-html/version.rb
Constant Summary collapse
- VERSION =
"0.13.1"
Instance Method Summary collapse
- #format(result) ⇒ Object
-
#initialize ⇒ HTMLFormatter
constructor
A new instance of HTMLFormatter.
Constructor Details
#initialize ⇒ HTMLFormatter
Returns a new instance of HTMLFormatter.
19 20 21 22 23 24 |
# File 'lib/simplecov-html.rb', line 19 def initialize @branchable_result = SimpleCov.branch_coverage? @templates = {} @inline_assets = !ENV["SIMPLECOV_INLINE_ASSETS"].nil? @public_assets_dir = File.join(File.dirname(__FILE__), "../public/") end |
Instance Method Details
#format(result) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/simplecov-html.rb', line 26 def format(result) unless @inline_assets Dir[File.join(@public_assets_dir, "*")].each do |path| FileUtils.cp_r(path, asset_output_path, remove_destination: true) end end File.open(File.join(output_path, "index.html"), "wb") do |file| file.puts template("layout").result(binding) end puts (result) end |