diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-05-03 19:42:20 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-05-03 19:42:20 +0100 |
commit | 58f5a950200f5957307a8552b92ce9e92f948b73 (patch) | |
tree | e7e5dbf2178dfd46e88e8e6d60d6665c58b538fa /lib/mauve/configuration_builders/alert_group.rb | |
parent | 3a008fd3fff00852533d0df1f597595505373c6b (diff) |
* Person and people lists have now become interchangeable, with notifications
only recording the username, rather than the Person/PeopleList. This means
that notifications in alert groups can use default #during clauses and #every
values from people lists and persons.
* Notify clauses can now take an array of persons/people_lists, and people_lists
can refer to other people lists.
* PeopleList names are now in the same namespace as usernames.
* Tests to go with.
Diffstat (limited to 'lib/mauve/configuration_builders/alert_group.rb')
-rw-r--r-- | lib/mauve/configuration_builders/alert_group.rb | 38 |
1 files changed, 3 insertions, 35 deletions
diff --git a/lib/mauve/configuration_builders/alert_group.rb b/lib/mauve/configuration_builders/alert_group.rb index 851ab7f..a813ee9 100644 --- a/lib/mauve/configuration_builders/alert_group.rb +++ b/lib/mauve/configuration_builders/alert_group.rb @@ -18,22 +18,8 @@ module Mauve # @raise [ArgumentError] if a username doesn't exist. # # @return [Mauve::Notification] New notification instance. - def builder_setup(who) - who = if who.is_a?(Mauve::Person) or who.is_a?(Mauve::PeopleList) - who - - elsif @context.people[who] - @context.people[who] - - elsif @context.people_lists[who] - @context.people_lists[who] - - else - raise ArgumentError.new("You have not declared who #{who} is") - - end - - @result = Mauve::Notification.new(who) + def builder_setup(*who) + @result = Mauve::Notification.new(*who) end is_attribute "every" @@ -65,25 +51,7 @@ module Mauve # def created_notify(notification) @result.notifications ||= [] - - if notification.during.nil? and notification.every.nil? - @result.notifications += notification.person.notifications.collect do |n| - # - # Set up a new notification for each one defined for this person. - # - new_notification = Mauve::Notification.new(notification.person) - new_notification.level = @result.level - new_notification.every = n.every - new_notification.during = n.during - new_notification - end - else - # - # Set the level for this notification - # - notification.level = @result.level - @result.notifications << notification - end + @result.notifications << notification end end |