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 ae2a050  Add counts and summary
ae2a050 is described below

commit ae2a050ce8c8c153dc97c9040bb99c806acfca32
Author: Sebb <[email protected]>
AuthorDate: Sat Sep 11 00:40:30 2021 +0100

    Add counts and summary
---
 www/roster/public_committee_info.rb | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/www/roster/public_committee_info.rb 
b/www/roster/public_committee_info.rb
index 245d54b..26890d2 100644
--- a/www/roster/public_committee_info.rb
+++ b/www/roster/public_committee_info.rb
@@ -1,6 +1,11 @@
 #{
 # Creates JSON output from committee-info.txt with the following format:
 #  "last_updated": "2016-03-04 04:50:00 UTC",
+#  "committee_count": 210,
+#  "roster_counts": {
+#    "accumulo": 40,
+#    ...
+#  },
 #  "committees": {
 #    "abdera": {
 #      "display_name": "Abdera",
@@ -48,11 +53,17 @@ require 'whimsy/asf/board'
 committees = ASF::Committee.load_committee_info
 
 # reformat the data
-info = {last_updated: ASF::Committee.svn_change}
+info = {
+  last_updated: ASF::Committee.svn_change,
+  committee_count: committees.size,
+  roster_counts: nil
+}
 
+roster_counts = {}
 info[:committees] = committees.map {|committee|
   schedule = committee.schedule.to_s.split(/,\s*/)
   schedule.unshift committee.report if committee.report != committee.schedule
+  cname = committee.name.gsub(/[^-\w]/, '')
   data = {
     display_name: committee.display_name,
     site: committee.site,
@@ -63,12 +74,15 @@ info[:committees] = committees.map {|committee|
     # Convert {:name=>"Public Name", :id=>"availid"} to
     # "chair": { "availid": { "name": "Public Name" } }
     chair: committee.chairs.map {|chair| [chair[:id], {:name => 
chair[:name]}]}.to_h,
+    roster_count: committee.roster.size,
     roster: committee.roster.sort.to_h, # sort entries by uid
     pmc: committee.pmc?
   }
+  roster_counts[cname] = committee.roster.size
   data[:paragraph] = committee.paragraph if committee.paragraph
-  [committee.name.gsub(/[^-\w]/, ''), data]
+  [cname, data]
 }.to_h
+info[:roster_counts] = roster_counts
 
 info[:officers] =
   ASF::Committee.officers.map { |officer|

Reply via email to