From 9353a8af6b78d0bcf743420713700dcb58e64e66 Mon Sep 17 00:00:00 2001 From: Sebb Date: Mon, 27 May 2024 15:34:06 +0100 Subject: [PATCH] Merge mail_list into main class --- lib/whimsy/asf/committee.rb | 42 ++++++++++++++++++++++++++++ lib/whimsy/asf/mail.rb | 56 ------------------------------------- lib/whimsy/asf/podling.rb | 10 +++++++ 3 files changed, 52 insertions(+), 56 deletions(-) diff --git a/lib/whimsy/asf/committee.rb b/lib/whimsy/asf/committee.rb index 0e9f0e7461..d9f53bfb8b 100644 --- a/lib/whimsy/asf/committee.rb +++ b/lib/whimsy/asf/committee.rb @@ -105,6 +105,48 @@ def self.to_canonical(name) @@namemap.call(name.downcase) end + # mailing list for this committee. Generally returns the first name in + # the dns (e.g. whimsical). If so, it can be prefixed by a number of + # list names (e.g. dev, private) and .apache.org is to be + # appended. In some cases, the name contains an @ sign and + # is the full name for the mail list. + def mail_list + case name.downcase + when 'comdev' + 'community' + when 'httpcomponents' + 'hc' + when 'whimsy' + 'whimsical' + + when 'brand' + 'trademarks@apache.org' + when 'infrastructure' + 'infra' + when 'dataprivacy' + 'privacy@apache.org' + when 'legalaffairs' # Not sure what uses this + 'legal-internal@apache.org' + when 'legal' # This seems to be used by the board agenda + 'legal-private@apache.org' + when 'fundraising' + 'fundraising-private@apache.org' + when 'marketingandpublicity' + 'press@apache.org' + # now using private@tac.apache.org + # when 'tac' + # 'travel-assistance@apache.org' + when 'w3crelations' + 'w3c@apache.org' + when 'concom' + 'planners@apachecon.com' + when 'publicaffairs' + 'public-affairs-private@apache.org' + else + name.downcase + end + end + # load committee info from committee-info.txt. Will not reparse # if the file has already been parsed and the underlying file has not # changed. diff --git a/lib/whimsy/asf/mail.rb b/lib/whimsy/asf/mail.rb index 38cea63142..944917f424 100644 --- a/lib/whimsy/asf/mail.rb +++ b/lib/whimsy/asf/mail.rb @@ -331,60 +331,4 @@ def all_mail end end - class Committee - # mailing list for this committee. Generally returns the first name in - # the dns (e.g. whimsical). If so, it can be prefixed by a number of - # list names (e.g. dev, private) and .apache.org is to be - # appended. In some cases, the name contains an @ sign and - # is the full name for the mail list. - def mail_list - case name.downcase - when 'comdev' - 'community' - when 'httpcomponents' - 'hc' - when 'whimsy' - 'whimsical' - - when 'brand' - 'trademarks@apache.org' - when 'infrastructure' - 'infra' - when 'dataprivacy' - 'privacy@apache.org' - when 'legalaffairs' # Not sure what uses this - 'legal-internal@apache.org' - when 'legal' # This seems to be used by the board agenda - 'legal-private@apache.org' - when 'fundraising' - 'fundraising-private@apache.org' - when 'marketingandpublicity' - 'press@apache.org' - # now using private@tac.apache.org - # when 'tac' - # 'travel-assistance@apache.org' - when 'w3crelations' - 'w3c@apache.org' - when 'concom' - 'planners@apachecon.com' - when 'publicaffairs' - 'public-affairs-private@apache.org' - else - name.downcase - end - end - end - - class Podling - # base name used in constructing mailing list name. - def mail_list - case name.downcase - when 'odftoolkit' - 'odf' - else - name.downcase - end - end - end - end diff --git a/lib/whimsy/asf/podling.rb b/lib/whimsy/asf/podling.rb index d2fa0cf374..b0ffb8c796 100644 --- a/lib/whimsy/asf/podling.rb +++ b/lib/whimsy/asf/podling.rb @@ -285,6 +285,16 @@ def hasLDAP? ASF::Project.find(id).hasLDAP? end + # base name used in constructing mailing list name. + def mail_list + case name.downcase + when 'odftoolkit' + 'odf' + else + name.downcase + end + end + # development mailing list associated with a given podling def dev_mail_list case name