You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2019/03/14 21:02:36 UTC

[whimsy] branch master updated: gmail.com == googlemail.com

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 9a972ed  gmail.com == googlemail.com
9a972ed is described below

commit 9a972ed3d875b68c16ee6c88cdde190129240477
Author: Sebb <se...@apache.org>
AuthorDate: Thu Mar 14 21:02:27 2019 +0000

    gmail.com == googlemail.com
---
 lib/spec/lib/mail/mail_spec.rb | 7 +++++--
 lib/whimsy/asf/mail.rb         | 3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/spec/lib/mail/mail_spec.rb b/lib/spec/lib/mail/mail_spec.rb
index 6c2e8dd..febd1dd 100644
--- a/lib/spec/lib/mail/mail_spec.rb
+++ b/lib/spec/lib/mail/mail_spec.rb
@@ -17,9 +17,12 @@ describe ASF::Mail do
     it "should return address with downcased domain for valid emails" do
       expect(ASF::Mail.to_canonical('ABC@DEF')).to eq('ABC@def')
     end    
-    it "should return address with downcased domain and canonicalised name for Google emails" do
+    it "should return address with downcased domain and canonicalised name for GMail emails" do
       expect(ASF::Mail.to_canonical('A.B.C+123@GMail.com')).to eq('abc@gmail.com')
     end    
+    it "should return address with downcased domain and canonicalised name for Googlemail emails" do
+      expect(ASF::Mail.to_canonical('A.B.C+123@Googlemail.com')).to eq('abc@gmail.com')
+    end    
   end
 
   describe '.cansub(member, pmc_chair, ldap_pmcs)' do
@@ -49,7 +52,7 @@ describe ASF::Mail do
     it 'should return private PPMC lists' do
       podnames = ASF::Podling.current.map(&:name)
       mylists = ASF::Mail.cansub(false, false, podnames) - lists
-      expect(mylists.length).to be(podnames.length)
+      expect(mylists.length).to be_between(podnames.length-2, podnames.length).inclusive # mailing list may not be set up yet
     end
   end
 end
diff --git a/lib/whimsy/asf/mail.rb b/lib/whimsy/asf/mail.rb
index 09a1f35..1a68bc6 100644
--- a/lib/whimsy/asf/mail.rb
+++ b/lib/whimsy/asf/mail.rb
@@ -163,7 +163,8 @@ module ASF
         name, dom = parts
         return email if name.length == 0 || dom.length == 0
         dom.downcase!
-        if %w(gmail.com googlemail.com).include? dom
+        dom = 'gmail.com' if dom == 'googlemail.com' # same mailbox
+        if dom == 'gmail.com'
           return name.sub(/\+.*/,'').gsub('.','').downcase + '@' + dom
         else
           # Effectively the same: