whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [1/1] Commit 8fc28a9: complete nominations cross-check
Date Mon, 22 Feb 2016 19:12:19 GMT
Commit 8fc28a99a2f0933ea01063a22ca64cd224cf30e0:
    complete nominations cross-check


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
www/members/nominations.cgi                                  | +++++++++ ----
------------------------------------------------------------
47 changes: 33 additions, 14 deletions.
------------------------------------------------------------


diff --git a/www/members/nominations.cgi b/www/members/nominations.cgi
index 67c8413..f5165fd 100755
--- a/www/members/nominations.cgi
+++ b/www/members/nominations.cgi
@@ -8,16 +8,18 @@ require 'whimsy/asf'
 # link to members private-arch
 MBOX = 'https://mail-search.apache.org/members/private-arch/members/'
 
+# link to roster page
+ROSTER = 'https://whimsy.apache.org/roster/committer'
+
 # get a list of current members messages
-archive = Dir['/home/apmail/members/archive/*/*']
+year = Time.new.year.to_s
+archive = Dir["/srv/mail/members/#{year}*/*"]
 
 # select messages that have a subject line starting with [MEMBER NOMINATION]
 emails = []
-year = Time.new.year.to_s
 archive.each do |email|
   next if email.end_with? '/index'
   message = IO.read(email, mode: 'rb')
-  puts message[/^Date: .*/]
   next unless message[/^Date: .*/].to_s.include? year
   subject = message[/^Subject: .*/]
   next unless subject.include? "[MEMBER NOMINATION]"
@@ -25,34 +27,51 @@ archive.each do |email|
   emails << mail if mail.subject.start_with? "[MEMBER NOMINATION]"
 end
 
-# 
+# parse nominations for names and ids
 MEETINGS = ASF::SVN['private/foundation/Meetings']
 meeting = Dir["#{MEETINGS}/2*"].sort.last
 nominations = IO.read("#{meeting}/nominated-members.txt").
-  scan(/^-+--\s+(.*?)\n/).flatten.
-  map {|name| name.gsub(/<.*|\(\w+@.*/, '').strip}
-nominations.shift if nominations.first.empty?
+  scan(/^-+--\s+(.*?)\n/).flatten
+
+nominations.shift if nominations.first == '<empty line>'
 nominations.pop if nominations.last.empty?
 
+nominations.map! do |line| 
+  {name: line.gsub(/<.*|\(\w+@.*/, '').strip, id: line[/([.\w]+)@/, 1]}
+end
 
-url = `cd #{meeting}; svn info`[/URL: (.*)/, 1]
+# location of svn repository
+svnurl = `cd #{meeting}; svn info`[/URL: (.*)/, 1]
 
 # produce HTML output of reports, highlighting ones that have not (yet)
 # been posted
 _html do
+  _title 'Member nominations cross-check'
+
   _style %{
     .missing {background-color: yellow}
   }
 
-  _h1 "Nominations in SVN"
-  _a File.basename(meeting), href: File.join(url, 'nominated-members.txt')
-  _ul nominations.sort do |name|
-    _li name
+  # common banner
+  _a href: 'https://whimsy.apache.org/' do
+    _img title: "ASF Logo", alt: "ASF Logo",
+      src: "https://www.apache.org/img/asf_logo.png"
+  end
+
+  _h1_! do
+    _ "Nominations in "
+    _a 'svn', href: File.join(svnurl, 'nominated-members.txt')
+  end
+
+  _ul nominations.sort_by {|person| person[:name]} do |person|
+    _li! do
+      _a person[:name], href: "#{ROSTER}/#{person[:id]}"
+    end
   end
 
-  nominations.map!(&:downcase)
+  nominations.map! {|person| person[:name].downcase}
 
-  _h1.posted! "Posted nominations reports"
+  _h1_.posted! "Posted nominations reports"
 
   # attempt to sort reports by PMC name
   emails.sort_by! do |mail| 

Mime
View raw message