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 6c7653e  Show last update time on page
6c7653e is described below

commit 6c7653e35f03e24ca65f6a07d75865828f27c50d
Author: Sebb <[email protected]>
AuthorDate: Sun Jul 2 00:47:55 2017 +0100

    Show last update time on page
---
 lib/whimsy/asf/mlist.rb       | 12 ++++--------
 www/board/subscriptions.cgi   |  9 ++++++---
 www/members/subscriptions.cgi | 12 ++++++++----
 3 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/lib/whimsy/asf/mlist.rb b/lib/whimsy/asf/mlist.rb
index f800be6..d7ad837 100644
--- a/lib/whimsy/asf/mlist.rb
+++ b/lib/whimsy/asf/mlist.rb
@@ -9,11 +9,9 @@ module ASF
     # Potentially also the methods could check if access was allowed.
     # This is currently done by the callers
     
-    # yield the list of board subscribers
+    # Return an array of board subscribers followed by the file update time
     def self.board_subscribers
-      File.readlines(BOARD_SUBSCRIPTIONS).each do |line|
-        yield line.strip
-      end
+      return File.read(BOARD_SUBSCRIPTIONS).split("\n"), 
File.mtime(BOARD_SUBSCRIPTIONS)
     end
     ## When more frequent cronjobs are possible, the above Could be replaced 
by:
 #    def self.board_subscribers
@@ -24,11 +22,9 @@ module ASF
 #      end
 #    end
 
-    # yield the list of subscribers to members@
+    # Return an array of members@ subscribers followed by the file update time
     def self.members_subscribers
-      File.readlines(MEMBERS_SUBSCRIPTIONS).each do |line|
-        yield line.strip
-      end
+      return File.read(MEMBERS_SUBSCRIPTIONS).split("\n"), 
File.mtime(MEMBERS_SUBSCRIPTIONS)
     end
 
     ## When more frequent cronjobs are possible, the above Could be replaced 
by:
diff --git a/www/board/subscriptions.cgi b/www/board/subscriptions.cgi
index 1f1b641..1eb03c6 100755
--- a/www/board/subscriptions.cgi
+++ b/www/board/subscriptions.cgi
@@ -17,6 +17,7 @@ ARCHIVERS = %w(
 
 info_chairs = ASF::Committee.load_committee_info.group_by(&:chair)
 ldap_chairs = ASF.pmc_chairs
+subscribers, modtime = ASF::MLIST.board_subscribers
 
 _html do
   _head_ do
@@ -33,15 +34,17 @@ _html do
     _h1 'Apache pmc-chair/board list'
 
     _p! do
-      _ 'This process starts with the list of subscribers to '
+      _ "This process starts with the list of subscribers (updated #{modtime}) 
to "
       _a '[email protected]', href: 
'https://mail-search.apache.org/members/private-arch/board/'
-      _ '.  '
+      _br
+      _ 'These are matched against '
       _a 'members.txt', href: 
'https://svn.apache.org/repos/private/foundation/members.txt'
       _ ', '
       _a 'iclas.txt', href: 
'https://svn.apache.org/repos/private/foundation/officers/iclas.txt'
       _ ', and '
       _code 'ldapsearch mail'
       _ ' to attempt to match the email address to an Apache ID.  '
+      _br
       _ 'Those that are not found are listed as '
       _code.issue '*missing*'
       _ '.  ASF members are '
@@ -72,7 +75,7 @@ _html do
     ids = []
     maillist = ASF::Mail.list
 
-    ASF::MLIST.board_subscribers do |line|
+    subscribers.each do |line|
       person = maillist[line.downcase]
       person ||= maillist[line.downcase.sub(/\+\w+@/,'@')]
       if person
diff --git a/www/members/subscriptions.cgi b/www/members/subscriptions.cgi
index 107e56c..42a1201 100755
--- a/www/members/subscriptions.cgi
+++ b/www/members/subscriptions.cgi
@@ -16,6 +16,8 @@ ARCHIVERS = %w(
   [email protected]
 )
 
+subscribers, modtime = ASF::MLIST.members_subscribers
+
 _html do
   _body? do
     _whimsy_body(
@@ -27,15 +29,17 @@ _html do
       },
       helpblock: -> {
         _p! do
-          _ 'This process starts with the list of subscribers to '
+          _ "This process starts with the list of subscribers (updated 
#{modtime}) to "
           _a '[email protected]', href: 
'https://mail-search.apache.org/members/private-arch/members/'
-          _ '.  It then uses '
+          _br
+          _ 'These are matched against '
           _a 'members.txt', href: 
'https://svn.apache.org/repos/private/foundation/members.txt'
           _ ', '
           _a 'iclas.txt', href: 
'https://svn.apache.org/repos/private/foundation/officers/iclas.txt'
           _ ', and '
           _code 'ldapsearch mail'
-          _ ' to attempt to match the email address to an Apache ID.  '
+          _ ' to attempt to match the email address to an Apache ID.'
+          _br
           _ 'Those that are not found are listed as '
           _code.text_danger '*missing*'
           _ '.  Emeritus members are '
@@ -67,7 +71,7 @@ _html do
     maillist = ASF::Mail.list
 
     subscriptions = []
-    ASF::MLIST.members_subscribers do |line|
+    subscribers.each do |line|
       person = maillist[line.downcase]
       person ||= maillist[line.downcase.sub(/[-+]\w+@/,'@')] # allow for 
trailing +- suffix
       if person

-- 
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].

Reply via email to