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 98afd90  Shorten output
98afd90 is described below

commit 98afd909f30bfd6ed8a35baf933bac34bd83a721
Author: Sebb <[email protected]>
AuthorDate: Sat Sep 11 09:52:48 2021 +0100

    Shorten output
---
 www/roster/public_ldap_projects.rb | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/www/roster/public_ldap_projects.rb 
b/www/roster/public_ldap_projects.rb
index 42a3948..05d7ebf 100644
--- a/www/roster/public_ldap_projects.rb
+++ b/www/roster/public_ldap_projects.rb
@@ -34,6 +34,17 @@
 
 require_relative 'public_json_common'
 
+# Simple class to squash count output
+class Counts
+  def initialize(hash)
+    @hash = hash
+  end
+
+  def to_json(*_opts)
+    @hash.to_json()
+  end
+end
+
 # gather project group info
 entries = {}
 
@@ -74,7 +85,7 @@ projects.keys.sort_by(&:name).each do |entry|
     members: m,
     owners: o
   }
-  roster_counts[entry.name] = {members: m.size, owners: o.size}
+  roster_counts[entry.name] = Counts.new({members: m.size, owners: o.size})
   committee = committees[entry.name]
   if committee
     if committee.pmc?

Reply via email to