Class: Coverband::Reporters::ConsoleReport

Inherits:
Base
  • Object
show all
Defined in:
lib/coverband/reporters/console_report.rb

Overview

Console Report allows for simple reporting via the command line.

Constant Summary

Constants inherited from Base

Base::DATA_KEY

Class Method Summary collapse

Methods inherited from Base

fix_reports

Class Method Details

.report(store, options = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/coverband/reporters/console_report.rb', line 9

def self.report(store, options = {})
  coverband_reports = Coverband::Reporters::Base.report(store, options)
  fix_reports(coverband_reports)
  result = Coverband::Utils::Results.new(coverband_reports)
  source_files = result.source_files

  Coverband.configuration.logger.info "total_files: #{source_files.length}"
  Coverband.configuration.logger.info "lines_of_code: #{source_files.lines_of_code}"
  Coverband.configuration.logger.info "lines_covered: #{source_files.covered_lines}"
  Coverband.configuration.logger.info "lines_missed: #{source_files.missed_lines}"
  Coverband.configuration.logger.info "covered_percent: #{source_files.covered_percent}"

  coverband_reports[:merged].each_pair do |file, usage|
    Coverband.configuration.logger.info "#{file}: #{usage["data"]}"
  end
  coverband_reports
end