Class: XunitViewer::Renderer
- Inherits:
-
ERB
- Object
- ERB
- XunitViewer::Renderer
- Defined in:
- lib/xunit_viewer.rb
Overview
A renderer for JUnit/Xunit results
Instance Attribute Summary collapse
-
#brand_logo_url ⇒ String
The URL to a brand logo.
-
#favicon_url ⇒ String
The URL to a favicon logo.
-
#title ⇒ String
The title of the report.
Instance Method Summary collapse
-
#initialize(input_files, title: nil, brand_logo_url: nil, favicon_url: nil) ⇒ Renderer
constructor
A new instance of Renderer.
-
#result ⇒ String
The rendered template.
Constructor Details
#initialize(input_files, title: nil, brand_logo_url: nil, favicon_url: nil) ⇒ Renderer
Returns a new instance of Renderer.
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/xunit_viewer.rb', line 29 def initialize(input_files, title: nil, brand_logo_url: nil, favicon_url: nil) @files = input_files.is_a?(Hash) ? input_files : input_files.each_with_object({}) { |f, acc| acc[f] = IO.read(f) } @title = title @brand_logo_url = brand_logo_url @favicon_url = favicon_url # this "filename" is from the parent class filename = File.("./report_template.erb", __dir__) template = File.read(filename) @filename = filename super(template) end |
Instance Attribute Details
#brand_logo_url ⇒ String
Returns the URL to a brand logo.
20 21 22 |
# File 'lib/xunit_viewer.rb', line 20 def brand_logo_url @brand_logo_url end |
#favicon_url ⇒ String
Returns the URL to a favicon logo.
23 24 25 |
# File 'lib/xunit_viewer.rb', line 23 def favicon_url @favicon_url end |
#title ⇒ String
Returns the title of the report.
17 18 19 |
# File 'lib/xunit_viewer.rb', line 17 def title @title end |
Instance Method Details
#result ⇒ String
Returns the rendered template.
43 44 45 |
# File 'lib/xunit_viewer.rb', line 43 def result super(binding) end |