class XunitViewer::Renderer

A renderer for JUnit/Xunit results

Attributes

brand_logo_url[RW]

@return [String] the URL to a brand logo

favicon_url[RW]

@return [String] the URL to a favicon logo

title[RW]

@return [String] the title of the report

Public Class Methods

new(input_files, title: nil, brand_logo_url: nil, favicon_url: nil) click to toggle source

@param input_files [Mixed] Either an array of JUnit/XUnit report filenames, or hash of name => contents @param title [String] the report title @param brand_logo_url [String] the URL to a brand logo @param favicon_url [String] the URL to a favicon

Calls superclass method
# 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.expand_path("./report_template.erb", __dir__)
  template = File.read(filename)
  @filename = filename
  super(template)
end

Public Instance Methods

result() click to toggle source

@return [String] the rendered template

Calls superclass method
# File lib/xunit_viewer.rb, line 43
def result
  super(binding)
end