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/01/30 11:40:10 UTC

[whimsy] branch master updated: Use method rather than referencing constant

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 b855a61  Use method rather than referencing constant
b855a61 is described below

commit b855a6158036413aeee4fd77ef13b40f115e5c91
Author: Sebb <se...@apache.org>
AuthorDate: Wed Jan 30 11:40:03 2019 +0000

    Use method rather than referencing constant
    
    Makes it easier to change the ldap code
---
 www/board/agenda/views/actions/todos.json.rb | 2 +-
 www/roster/models/committee.rb               | 2 +-
 www/roster/models/nonpmc.rb                  | 2 +-
 www/roster/public_ldap_committees.rb         | 2 +-
 www/roster/public_ldap_groups.rb             | 2 +-
 www/roster/views/actions/committee.json.rb   | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/www/board/agenda/views/actions/todos.json.rb b/www/board/agenda/views/actions/todos.json.rb
index c2196b6..fbc3548 100644
--- a/www/board/agenda/views/actions/todos.json.rb
+++ b/www/board/agenda/views/actions/todos.json.rb
@@ -118,7 +118,7 @@ if @establish and env.password
     people = item['people'].map {|id, hash| [id, hash[:name]]}
 
     ASF::LDAP.bind(env.user, env.password) do
-      guineapig = ASF::Committee::GUINEAPIGS.include?(pmc.downcase)
+      guineapig = ASF::Committee::isGuineaPig?(pmc.downcase)
 
       # old style definitions
       unless guineapig
diff --git a/www/roster/models/committee.rb b/www/roster/models/committee.rb
index b237b41..43aaf65 100644
--- a/www/roster/models/committee.rb
+++ b/www/roster/models/committee.rb
@@ -163,7 +163,7 @@ class Committee
       nonASFmails: nonASFmails,
       project_info: info,
       image: image,
-      guinea_pig: ASF::Committee::GUINEAPIGS.include?(id),
+      guinea_pig: ASF::Committee::isGuineaPig?(id),
       analysePrivateSubs: analysePrivateSubs,
       unknownSubs: unknownSubs,
       asfMembers: asfMembers,
diff --git a/www/roster/models/nonpmc.rb b/www/roster/models/nonpmc.rb
index 46f6089..21243fc 100644
--- a/www/roster/models/nonpmc.rb
+++ b/www/roster/models/nonpmc.rb
@@ -166,7 +166,7 @@ class NonPMC
       subtime: subtime,
       nonASFmails: nonASFmails,
       image: image,
-      guinea_pig: ASF::Committee::GUINEAPIGS.include?(id),
+      guinea_pig: ASF::Committee::isGuineaPig?(id),
       analysePrivateSubs: analysePrivateSubs,
       unknownSubs: unknownSubs,
       asfMembers: asfMembers,
diff --git a/www/roster/public_ldap_committees.rb b/www/roster/public_ldap_committees.rb
index 0ccca7a..587f7f1 100644
--- a/www/roster/public_ldap_committees.rb
+++ b/www/roster/public_ldap_committees.rb
@@ -40,7 +40,7 @@ end
 
 committees.keys.sort_by {|a| a.name}.each do |entry|
     m = []
-    if ASF::Committee::GUINEAPIGS.include? entry.name
+    if ASF::Committee::isGuineaPig? entry.name
         project = ASF::Project.find(entry.name)
         createTimestamp = project.createTimestamp
         modifyTimestamp = project.modifyTimestamp
diff --git a/www/roster/public_ldap_groups.rb b/www/roster/public_ldap_groups.rb
index f20ba19..fbec482 100644
--- a/www/roster/public_ldap_groups.rb
+++ b/www/roster/public_ldap_groups.rb
@@ -40,7 +40,7 @@ end
 
 groups.keys.sort_by {|a| a.name}.each do |entry|
     m = []
-    if ASF::Committee::GUINEAPIGS.include? entry.name
+    if ASF::Committee::isGuineaPig? entry.name
       project = ASF::Project.find(entry.name)
       createTimestamp = project.createTimestamp
       modifyTimestamp = project.modifyTimestamp
diff --git a/www/roster/views/actions/committee.json.rb b/www/roster/views/actions/committee.json.rb
index e7ff97d..08b2174 100644
--- a/www/roster/views/actions/committee.json.rb
+++ b/www/roster/views/actions/committee.json.rb
@@ -106,7 +106,7 @@ if env.password
   end
 
   details = people.map {|person| person.dn}
-  if ASF::Committee::GUINEAPIGS.include? pmc.id
+  if ASF::Committee::isGuineaPig? pmc.id
     details << "#{pmc.dn};attr=owner" if @targets.include? 'pmc'
     details << "#{pmc.dn};attr=member" if group
   else