4 # Override this method in your Configurable (optional)
6 # Called once after the Configurable has been sent to the block and attributes have been
7 # set. Do any post-processing on attributes here
16 # Override this method in your Configurable (optional)
18 # Called once during evaluation of the config file. Return true if valid, false otherwise
20 # A convenience method 'complain' is available that will print out a message and return false,
21 # making it easy to report multiple validation errors:
25 # valid &= complain("You must specify the 'pid_file' attribute for :memory_usage") if self.pid_file.nil?
26 # valid &= complain("You must specify the 'above' attribute for :memory_usage") if self.above.nil?
34 self.class.name.split('::').last
41 def self.complain(text, c = nil)
42 watch = c.watch rescue nil
44 msg += "#{watch.name}: " if watch
46 msg += " for #{c.friendly_name}" if c
47 applog(watch, :error, msg)
51 def complain(text, c = nil)
52 Configurable.complain(text, c)