| Rcov report for: app/models/hudson_health_report.rb| Name | Total lines | Lines of code | Total coverage | Code coverage | | app/models/hudson_health_report.rb | 30 | 23 | | |
1 # To change this template, choose Tools | Templates | 2 # and open the template in the editor. | 3 | 4 class HudsonHealthReport < ActiveRecord::Base | 5 unloadable | 6 belongs_to :job, :class_name => 'HudsonJob', :foreign_key => 'hudson_job_id' | 7 | 8 include HudsonHelper | 9 include RexmlHelper | 10 | 11 def update_by_xml(element) | 12 self.description = get_element_value(element, "description") | 13 self.score = get_element_value(element, "score") | 14 self.url = self.get_health_report_url(self.job) | 15 end | 16 | 17 def get_health_report_url(job) | 18 return "" unless job | 19 return "" unless self.job | 20 return "" unless self.job.settings | 21 return "" unless self.job.settings.health_report_settings | 22 self.job.settings.health_report_settings.each do |hr_settings| | 23 if hr_settings.contained_in?(self.description) | 24 return URI.escape(hr_settings.get_url(job)) | 25 end | 26 end | 27 return "" | 28 end | 29 | 30 end |
|