Rcov report for: app/models/hudson_settings_health_report.rb

NameTotal linesLines of codeTotal coverageCode coverage
app/models/hudson_settings_health_report.rb3124
100.00%
100.00%
1 class HudsonSettingsHealthReport < ActiveRecord::Base
2   unloadable
3   belongs_to :settings, :class_name => 'HudsonSettings', :foreign_key => 'hudson_settings_id'
4 
5   # ���������������������������
6   validates_presence_of :hudson_settings_id, :keyword, :url_format
7 
8   def HudsonSettingsHealthReport.is_blank?(hash)
9     return true if hash[:keyword] == nil and hash[:url_format] == nil
10     return true if hash[:keyword] == "" and hash[:url_format] == ""
11     return false
12   end
13 
14   def update_from_hash(value)
15     self.keyword = value[:keyword]
16     self.url_format = value[:url_format]
17   end
18 
19   def contained_in?(message)
20     return false unless message
21     return message.index(self.keyword) != nil
22   end
23 
24   def get_url(job)
25     ret_val = self.url_format
26     ret_val = ret_val.gsub('${hudson.url}', job.settings.url)
27     ret_val = ret_val.gsub('${job.name}', job.name)
28     return ret_val
29   end
30 
31 end