From e959c0fe4c887154bbe28c31324fef2975cbe467 Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Wed, 25 Apr 2012 17:15:49 +0100 Subject: Big update. * Max acknowledgement time is now specified in the config * Calendar interface improved. * holiday_url no longer used -- replaced by notify_when_on_holiday! * added notify_when_off_sick! * Added ability for the calendar to be queried for a list of bank holdays. * Added ability for Time to be given a list of bank holidays to check against. * PeopleLists can now be a Proc, allowing downloading of lists * Person is no longer a struct * Moved the method_missing bit into ObjectBuilder from various sub classes. * Added tests for the calendar interface * Updated tests in other bits. --- lib/mauve/people_list.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/mauve/people_list.rb') diff --git a/lib/mauve/people_list.rb b/lib/mauve/people_list.rb index eab4ae3..0433034 100644 --- a/lib/mauve/people_list.rb +++ b/lib/mauve/people_list.rb @@ -35,6 +35,8 @@ module Mauve arr = arr.flatten when String arr = [arr] + when Proc + arr = [arr] else logger.warn "Not sure what to do with #{arr.inspect} -- converting to string, and continuing" arr = [arr.to_s] @@ -62,10 +64,12 @@ module Mauve # # @return [Array] def people - l = list.collect do |name| - Configuration.current.people.has_key?(name) ? Configuration.current.people[name] : nil - end.reject{|person| person.nil?} + name.is_a?(Proc) ? name.call : name + end.flatten.compact.uniq.collect do |name| + Configuration.current.people[name] + end.compact + # # Hmm.. no-one in the list?! # -- cgit v1.2.1