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 4094e88  Allow for empty trailer
4094e88 is described below

commit 4094e8868bbb6096cae0eaeb8c744c4a40141443
Author: Sebb <[email protected]>
AuthorDate: Sat Feb 13 14:31:32 2021 +0000

    Allow for empty trailer
---
 lib/whimsy/asf/nominated-members.rb | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/lib/whimsy/asf/nominated-members.rb 
b/lib/whimsy/asf/nominated-members.rb
index 306b08b..c5566d7 100644
--- a/lib/whimsy/asf/nominated-members.rb
+++ b/lib/whimsy/asf/nominated-members.rb
@@ -39,9 +39,9 @@ module ASF
           .drop(2) # instructions and sample block
           .each do |block|
         nominee = {}
-        id = '?'
+        id = nil
+        block.shift(2) # divider and blank line
         block
-            .drop(2) # divider and blank line
             .slice_before(/^ +(\S+ \S+):\s*/) # split on the header names
             .each_with_index do |para, idx|
           if idx == 0 # id and name
@@ -57,7 +57,15 @@ module ASF
             end
           end
         end
-        nominees[id] = nominee
+        if id
+          nominees[id] = nominee if id
+        else
+          unless block.join('') =~ /^\s+$/ # all blank, e.g. trailing divider
+            Wunderbar.warn "Error, could not find public name"
+            Wunderbar.warn block.inspect
+            nominees['notinavail'] = {'Public Name' => '-- WARNING: unable to 
parse section --'}
+          end
+        end
       end
       nominees
     end

Reply via email to