Class: LicenseFinder::JunitReport

Inherits:
ErbReport show all
Defined in:
lib/license_finder/reports/junit_report.rb

Constant Summary collapse

ROOT_PATH =
Pathname.new(__FILE__).dirname
TEMPLATE_PATH =
ROOT_PATH.join('templates')

Instance Method Summary collapse

Methods inherited from Report

#initialize, of

Constructor Details

This class inherits a constructor from LicenseFinder::Report

Instance Method Details

#to_s(filename = TEMPLATE_PATH.join("#{template_name}.erb")) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/license_finder/reports/junit_report.rb', line 8

def to_s(filename = TEMPLATE_PATH.join("#{template_name}.erb"))
  if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.6.0')
    template = ERB.new(filename.read, nil, '-')
  else
    template = ERB.new(filename.read, trim_mode: '-')
  end
  template.result(binding)
end