Class: Coverband::Reporters::HTMLReport
- Defined in:
- lib/coverband/reporters/html_report.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#base_path ⇒ Object
Returns the value of attribute base_path.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#filtered_report_files ⇒ Object
Returns the value of attribute filtered_report_files.
-
#notice ⇒ Object
Returns the value of attribute notice.
-
#open_report ⇒ Object
Returns the value of attribute open_report.
-
#page ⇒ Object
Returns the value of attribute page.
Instance Method Summary collapse
- #file_details ⇒ Object
-
#initialize(store, options = {}) ⇒ HTMLReport
constructor
A new instance of HTMLReport.
- #report ⇒ Object
- #report_data ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(store, options = {}) ⇒ HTMLReport
Returns a new instance of HTMLReport.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/coverband/reporters/html_report.rb', line 9 def initialize(store, = {}) self.page = .fetch(:page) { nil } self.open_report = .fetch(:open_report) { true } # TODO: refactor notice out to top level of web only self.notice = .fetch(:notice) { nil } self.base_path = .fetch(:base_path) { "./" } self.filename = .fetch(:filename) { nil } coverband_reports = Coverband::Reporters::Base.report(store, ) # NOTE: at the moment the optimization around paging and filenames only works for hash redis store self.filtered_report_files = if (page || filename) && store.is_a?(Coverband::Adapters::HashRedisStore) coverband_reports else self.class.fix_reports(coverband_reports) end end |
Instance Attribute Details
#base_path ⇒ Object
Returns the value of attribute base_path.
6 7 8 |
# File 'lib/coverband/reporters/html_report.rb', line 6 def base_path @base_path end |
#filename ⇒ Object
Returns the value of attribute filename.
6 7 8 |
# File 'lib/coverband/reporters/html_report.rb', line 6 def filename @filename end |
#filtered_report_files ⇒ Object
Returns the value of attribute filtered_report_files.
6 7 8 |
# File 'lib/coverband/reporters/html_report.rb', line 6 def filtered_report_files @filtered_report_files end |
#notice ⇒ Object
Returns the value of attribute notice.
6 7 8 |
# File 'lib/coverband/reporters/html_report.rb', line 6 def notice @notice end |
#open_report ⇒ Object
Returns the value of attribute open_report.
6 7 8 |
# File 'lib/coverband/reporters/html_report.rb', line 6 def open_report @open_report end |
#page ⇒ Object
Returns the value of attribute page.
6 7 8 |
# File 'lib/coverband/reporters/html_report.rb', line 6 def page @page end |
Instance Method Details
#file_details ⇒ Object
26 27 28 29 30 |
# File 'lib/coverband/reporters/html_report.rb', line 26 def file_details Coverband::Utils::HTMLFormatter.new(filtered_report_files, base_path: base_path, notice: notice).format_source_file!(filename) end |
#report ⇒ Object
32 33 34 |
# File 'lib/coverband/reporters/html_report.rb', line 32 def report report_dynamic_html end |
#report_data ⇒ Object
36 37 38 |
# File 'lib/coverband/reporters/html_report.rb', line 36 def report_data report_dynamic_data end |