Class: CoverMe::EmmaFormatter
- Defined in:
- lib/cover_me/emma_formatter.rb
Overview
Generates Emma-style xml coverage files.
Instance Attribute Summary
Attributes inherited from Formatter
Instance Method Summary collapse
-
#format_index(index) ⇒ Object
Formats a CoverMe::Index object using the emma.xml.erb template.
- #format_report(report) ⇒ Object
-
#initialize(options = {}) ⇒ EmmaFormatter
constructor
:nodoc:.
Methods inherited from Formatter
Constructor Details
#initialize(options = {}) ⇒ EmmaFormatter
:nodoc:
4 5 6 7 |
# File 'lib/cover_me/emma_formatter.rb', line 4 def initialize( = {}) # :nodoc: super self. = ({:output_path => CoverMe.config.emma_formatter.output_path}.merge(self.)).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 |