Class: Coverband::Utils::HTMLFormatter
- Inherits:
-
Object
- Object
- Coverband::Utils::HTMLFormatter
- Defined in:
- lib/coverband/utils/html_formatter.rb
Instance Attribute Summary collapse
-
#base_path ⇒ Object
readonly
Returns the value of attribute base_path.
-
#notice ⇒ Object
readonly
Returns the value of attribute notice.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#tracker ⇒ Object
readonly
Returns the value of attribute tracker.
Instance Method Summary collapse
- #format_abstract_tracker! ⇒ Object
- #format_dynamic_data! ⇒ Object
- #format_dynamic_html! ⇒ Object
- #format_settings! ⇒ Object
- #format_source_file!(filename) ⇒ Object
-
#initialize(report, options = {}) ⇒ HTMLFormatter
constructor
A new instance of HTMLFormatter.
Constructor Details
#initialize(report, options = {}) ⇒ HTMLFormatter
Returns a new instance of HTMLFormatter.
18 19 20 21 22 23 24 |
# File 'lib/coverband/utils/html_formatter.rb', line 18 def initialize(report, = {}) @notice = .fetch(:notice, nil) @base_path = .fetch(:base_path, "./") @tracker = .fetch(:tracker, nil) @page = .fetch(:page, nil) @coverage_result = Coverband::Utils::Results.new(report) if report end |
Instance Attribute Details
#base_path ⇒ Object (readonly)
Returns the value of attribute base_path.
16 17 18 |
# File 'lib/coverband/utils/html_formatter.rb', line 16 def base_path @base_path end |
#notice ⇒ Object (readonly)
Returns the value of attribute notice.
16 17 18 |
# File 'lib/coverband/utils/html_formatter.rb', line 16 def notice @notice end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
16 17 18 |
# File 'lib/coverband/utils/html_formatter.rb', line 16 def page @page end |
#tracker ⇒ Object (readonly)
Returns the value of attribute tracker.
16 17 18 |
# File 'lib/coverband/utils/html_formatter.rb', line 16 def tracker @tracker end |
Instance Method Details
#format_abstract_tracker! ⇒ Object
38 39 40 |
# File 'lib/coverband/utils/html_formatter.rb', line 38 def format_abstract_tracker! template("abstract_tracker").result(binding) end |
#format_dynamic_data! ⇒ Object
30 31 32 |
# File 'lib/coverband/utils/html_formatter.rb', line 30 def format_dynamic_data! format_data(@coverage_result) end |
#format_dynamic_html! ⇒ Object
26 27 28 |
# File 'lib/coverband/utils/html_formatter.rb', line 26 def format_dynamic_html! format_html(@coverage_result) end |
#format_settings! ⇒ Object
34 35 36 |
# File 'lib/coverband/utils/html_formatter.rb', line 34 def format_settings! format_settings end |
#format_source_file!(filename) ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'lib/coverband/utils/html_formatter.rb', line 42 def format_source_file!(filename) source_file = @coverage_result.file_from_path_with_type(filename) if source_file formatted_source_file(@coverage_result, source_file) else "File No Longer Available" end end |