Class: CI::Reporter::ReportManager
- Inherits:
-
Object
- Object
- CI::Reporter::ReportManager
- Defined in:
- lib/ci/reporter/report_manager.rb
Instance Method Summary collapse
-
#initialize(prefix) ⇒ ReportManager
constructor
A new instance of ReportManager.
- #write_report(suite) ⇒ Object
Constructor Details
#initialize(prefix) ⇒ ReportManager
Returns a new instance of ReportManager.
10 11 12 13 14 |
# File 'lib/ci/reporter/report_manager.rb', line 10 def initialize(prefix) @basedir = ENV['CI_REPORTS'] || File.("#{Dir.getwd}/#{prefix.downcase}/reports") @basename = "#{@basedir}/#{prefix.upcase}" FileUtils.mkdir_p(@basedir) end |
Instance Method Details
#write_report(suite) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/ci/reporter/report_manager.rb', line 16 def write_report(suite) filename = "#{@basename}-#{suite.name.gsub(/[^a-zA-Z0-9]+/, '-')}.xml" filename = "#{filename}_#{Time.now}" if File.exist? filename File.open(filename, "w") do |f| f << suite.to_xml end end |