Class: CoverMe::EmmaFormatter

Inherits:
Formatter show all
Defined in:
lib/cover_me/emma_formatter.rb

Overview

Generates Emma-style xml coverage files.

Instance Attribute Summary

Attributes inherited from Formatter

#options

Instance Method Summary collapse

Methods inherited from Formatter

#finalize, #format, #template

Constructor Details

#initialize(options = {}) ⇒ EmmaFormatter

:nodoc:



4
5
6
7
# File 'lib/cover_me/emma_formatter.rb', line 4

def initialize(options = {}) # :nodoc:
  super
  self.options = ({:output_path => CoverMe.config.emma_formatter.output_path}.merge(self.options)).to_mash
end

Instance Method Details

#format_index(index) ⇒ Object

Formats a CoverMe::Index object using the emma.xml.erb template



14
15
16
17
18
19
20
# File 'lib/cover_me/emma_formatter.rb', line 14

def format_index(index)
  reports_by_dir = CoverMe::DirectoryReport.summarize(index.reports)
  global = CoverMe::GlobalReport.new(reports_by_dir)
  write_file('coverage') do |file|
    file.write(self.template('emma.xml.erb').result(binding))
  end
end

#format_report(report) ⇒ Object



9
10
11
# File 'lib/cover_me/emma_formatter.rb', line 9

def format_report(report)
  # nothing to do
end