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 3cfa0c6  Partial fix for WHIMSY-187
3cfa0c6 is described below

commit 3cfa0c625dc9781c5a36cd19881b1ec2755251bf
Author: Shane Curcuru <[email protected]>
AuthorDate: Sun Mar 25 20:42:51 2018 -0400

    Partial fix for WHIMSY-187
    
    When action items lack Status: string, just store text.strip as a
    fallback.
---
 lib/whimsy/asf/agenda/back.rb | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/lib/whimsy/asf/agenda/back.rb b/lib/whimsy/asf/agenda/back.rb
index f1251ee..fca06a2 100644
--- a/lib/whimsy/asf/agenda/back.rb
+++ b/lib/whimsy/asf/agenda/back.rb
@@ -36,17 +36,26 @@ class ASF::Board::Agenda
 
         attrs['actions'] = text.sub(/^\* /, '').split(/^\n\* /).map do |text|
           match1 = /(.*?)(\n\s*Status:(.*))/m.match(text)
-          match2 = /(.*?)(\[ ([^\]]+) \])?\s*\Z/m.match(match1[1])
-          match3 = /(.*?): (.*)\Z/m.match(match2[1])
-          match4 = /(.*?)( (\d+-\d+-\d+))?$/.match(match2[3])
-
-          { 
-            owner: match3[1],
-            text: match3[2].strip,
-            status: match1[3].to_s.strip,
-            pmc: (match4[1] if match4), 
-            date: (match4[3] if match4)
-          }
+          if match1
+            match2 = /(.*?)(\[ ([^\]]+) \])?\s*\Z/m.match(match1[1])
+            match3 = /(.*?): (.*)\Z/m.match(match2[1])
+            match4 = /(.*?)( (\d+-\d+-\d+))?$/.match(match2[3])
+            { 
+              owner: match3[1],
+              text: match3[2].strip,
+              status: match1[3].to_s.strip,
+              pmc: (match4[1] if match4), 
+              date: (match4[3] if match4)
+            }
+          else # Just copy text for items with no Status: see WHIMSY-187
+            { 
+              owner: '',
+              text: text.strip,
+              status: '',
+              pmc: '', 
+              date: ''
+            }
+          end
         end
       end
     end

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to