diff options
author | Alex Young <alex@bytemark.co.uk> | 2015-02-23 19:22:33 +0000 |
---|---|---|
committer | Alex Young <alex@bytemark.co.uk> | 2015-02-23 19:22:33 +0000 |
commit | 16ba9f08109ddb911e9aba8518a93d3df710a46b (patch) | |
tree | 0d7835a257ad5a4c47af47f6a2f7b67fe076f287 /lib/mauve/configuration_builders | |
parent | b212665b4e5ecaf9652ab7d3cfcd20597b3ef436 (diff) |
Get tests passing on ruby 1.9.3-p551
Diffstat (limited to 'lib/mauve/configuration_builders')
-rw-r--r-- | lib/mauve/configuration_builders/person.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/mauve/configuration_builders/person.rb b/lib/mauve/configuration_builders/person.rb index 9cc09ab..5f08d19 100644 --- a/lib/mauve/configuration_builders/person.rb +++ b/lib/mauve/configuration_builders/person.rb @@ -27,10 +27,10 @@ module Mauve is_flag_attribute "notify_when_on_holiday" is_flag_attribute "notify_when_off_sick" - + # Sets the block for all levels of alert # - # @param [Block] block + # @param [Block] block def all(&block); urgent(&block); normal(&block); low(&block); end # @@ -56,8 +56,8 @@ module Mauve @result.suppress_notifications_after[in_period] = number_of_alerts # History.all( - # :limit => number_of_alerts, - # :order => :created_at.desc, + # :limit => number_of_alerts, + # :order => :created_at.desc, # :type => "notification", # :event.like => '% succeeded') end @@ -93,14 +93,14 @@ module Mauve # Add a default notification threshold # person.suppress_notifications_after[600] = 5 if person.suppress_notifications_after.empty? - + # # Add a default notify clause # if person.notifications.empty? default_notification = Notification.new(person) default_notification.every = 30.minutes - default_notification.during = lambda { working_hours? } + default_notification.during = Proc.new { working_hours? } person.notifications << default_notification end @@ -108,11 +108,11 @@ module Mauve # Set up some default notify levels. # if person.urgent.nil? and person.normal.nil? and person.low.nil? - person.urgent = lambda { sms ; xmpp ; email } - person.normal = lambda { xmpp ; email } - person.low = lambda { email } + person.urgent = Proc.new { sms ; xmpp ; email } + person.normal = Proc.new { xmpp ; email } + person.low = Proc.new { email } end - + @result.people[person.username] = person end |