You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by cu...@apache.org on 2019/05/31 16:19:36 UTC

[whimsy] branch master updated: Use constant and improve error display when svn not found

This is an automated email from the ASF dual-hosted git repository.

curcuru 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 341e58c  Use constant and improve error display when svn not found
341e58c is described below

commit 341e58c2fb7c5d0b8948b59f1fa312bd151dfcf8
Author: Shane Curcuru <as...@shanecurcuru.org>
AuthorDate: Fri May 31 12:19:26 2019 -0400

    Use constant and improve error display when svn not found
---
 www/members/mentors.cgi | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/www/members/mentors.cgi b/www/members/mentors.cgi
index 9e1fd86..d2fb914 100755
--- a/www/members/mentors.cgi
+++ b/www/members/mentors.cgi
@@ -9,6 +9,7 @@ require 'json'
 
 require_relative 'mentor-format'
 MENTORS_LIST = 'mentors'
+MENTORS_SVN = 'foundation_mentors'
 
 # Read apacheid.json and add data to mentors hash (side effect)
 # mentors[id][ERRORS] = "If errors rescued during read/find in ASF::Person"
@@ -42,10 +43,7 @@ end
 # produce HTML
 _html do
   _body? do
-    uimap = MentorFormat::get_uimap(ASF::SVN['foundation_mentors'])
-    mentors = read_mentors(ASF::SVN['foundation_mentors'])
-    errors, mentors = mentors.partition{ |k,v| v.has_key?(MentorFormat::ERRORS)}.map(&:to_h)
-    notavailable, mentors = mentors.partition{ |k,v| v.has_key?(MentorFormat::NOTAVAILABLE)}.map(&:to_h)
+    uimap = mentors = errors = notavailable = {} # Fill in later in case of errors
     _whimsy_body(
       title: PAGETITLE,
       subtitle: 'About This Mentoring Program',
@@ -57,6 +55,10 @@ _html do
         'https://community.apache.org' => 'Apache Community Development'
       },
       helpblock: -> {
+        uimap = MentorFormat::get_uimap(ASF::SVN[MENTORS_SVN])
+        mentors = read_mentors(ASF::SVN[MENTORS_SVN])
+        errors, mentors = mentors.partition{ |k,v| v.has_key?(MentorFormat::ERRORS)}.map(&:to_h)
+        notavailable, mentors = mentors.partition{ |k,v| v.has_key?(MentorFormat::NOTAVAILABLE)}.map(&:to_h)
         _p do
           _ 'This page lists experienced ASF Members who have volunteered to mentor newer ASF Members to help them get more involved in governance and operations within the larger Foundation as a whole.'
         end