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

rubys 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 4910857  configure host for sending of mail
4910857 is described below

commit 49108577acbd16f1dbfb7f078120ed693c22620a
Author: Sam Ruby <[email protected]>
AuthorDate: Thu May 24 16:32:37 2018 -0400

    configure host for sending of mail
---
 lib/whimsy/asf/agenda/discussion.rb            |  6 +--
 tools/collate_minutes.rb                       | 70 ++++++++++++++++++++++----
 www/board/agenda/views/actions/summary.json.rb |  1 +
 3 files changed, 65 insertions(+), 12 deletions(-)

diff --git a/lib/whimsy/asf/agenda/discussion.rb 
b/lib/whimsy/asf/agenda/discussion.rb
index 6c8fb44..5df8a3a 100644
--- a/lib/whimsy/asf/agenda/discussion.rb
+++ b/lib/whimsy/asf/agenda/discussion.rb
@@ -7,7 +7,7 @@ class ASF::Board::Agenda
     discussion = @file.split(/^ \d. Discussion Items\n/,2).last.
       split(/^ \d. .*Action Items/,2).first
     
-    if discussion !~ /\A\s{3,5}[A-Z]\.\s/
+    if discussion !~ /\A\s{3,5}[0-9A-Z]\.\s/
 
       # One (possibly empty) item for all Discussion Items
 
@@ -28,10 +28,10 @@ class ASF::Board::Agenda
       # Separate items for each individual Discussion Item
 
       pattern = /
-        \n+(?<indent>\s{3,5})(?<section>[A-Z])\.
+        \n+(?<indent>\s{3,5})(?<section>[0-9A-Z])\.
         \s(?<title>.*?)\n
         (?<text>.*?)
-        (?=\n\s{4}[A-Z]\.\s|\z)
+        (?=\n\s{3,5}[0-9A-Z]\.\s|\z)
       /mx
 
       scan discussion, pattern do |attrs|
diff --git a/tools/collate_minutes.rb b/tools/collate_minutes.rb
index 680494a..5f2899a 100755
--- a/tools/collate_minutes.rb
+++ b/tools/collate_minutes.rb
@@ -1,5 +1,6 @@
 #!/usr/bin/env ruby
 $LOAD_PATH.unshift File.realpath(File.expand_path('../../lib', __FILE__))
+puts $LOAD_PATH.first
 
 require 'whimsy/asf'
 require 'date'
@@ -70,7 +71,10 @@ Wunderbar.info "Processing minutes matching #{MINUTES_NAME}"
 if File.exist? "#{SITE_MINUTES}/index.html"
   input = Dir[MINUTES_PATH,
     "#{BOARD}/board_minutes_20*.txt"].
-    map {|name| File.stat(name).mtime}.push(File.stat(__FILE__).mtime).max
+    map {|name| File.stat(name).mtime}.
+    push(File.stat(__FILE__).mtime, ASF.library_mtime).
+    max
+
   if File.stat("#{SITE_MINUTES}/index.html").mtime >= input
     Wunderbar.info "All up to date!"
     exit unless force
@@ -441,12 +445,55 @@ seen={}
       establish += text
       next
     end
-    report = OpenStruct.new
-    report.title ||= title #.downcase
-    report.meeting = date
-    report.attach = '+' + title
-    report.text = text.strip
-    pending[title] = report
+
+    if title !~ /Discussion/ or text !~ /\A\n*\s{3,5}[0-9A-Z]\.\s.*\n\n/
+      report = OpenStruct.new
+      report.title ||= title #.downcase
+      report.meeting = date
+      report.attach = '+' + title
+      report.text = text.strip
+      pending[title] = report
+    else
+      text.scan(/
+        \s{3}[\s\d]([0-9A-Z])\. # agenda item
+        \s+(.*?)\n              # title
+        (.*?)                   # text
+        (?=\n\s{3,5}\d?[0-9A-Z]\.\s|\z) # next section
+      /mx).each do |attach,title,text|
+        if title.include? "\n" and title.length > 120
+         title = title.split("\n")
+         text = title[1..-1].join("\n") + "\n" + text
+         title = title[0]
+       end
+
+        report = OpenStruct.new
+        report.title = title.gsub(/\s+/, ' ')
+        report.meeting = date
+        report.attach = '+' + title
+        report.text = text.strip
+
+        if title =~ /budget|spending/i
+          report.subtitle = title
+          report.title = 'Budget'
+          report.attach = '@' + attach
+        elsif title =~ /Legal Affairs/
+          report.subtitle = title
+          report.title = 'Legal Affairs'
+          report.attach = '1' + attach
+        else
+          pmcs = %w{Geronimo iBATIS Santuario}
+          pmcs.each do |pmc|
+            if title =~ /#{pmc}/i
+              report.subtitle = title
+              report.title = pmc
+              report.attach = '.' + pmc
+            end
+          end
+       end
+
+        pending[title] = report
+      end
+    end
   end
 
   # parse Special Orders
@@ -530,6 +577,7 @@ seen={}
       1, 'Brand Management', /use.*feather/,
       1, 'Brand Management', /Trademark/,
       1, 'Brand Management', /use.*Apache name/,
+      1, 'Brand Management', /Brand Management/i,
       1, 'Travel Assistance', /TAC/,
       1, 'Travel Assistance', /Travel Assistance/,
       1, 'Conference Planning', /Conference Planning/,
@@ -772,7 +820,11 @@ agenda.sort.each do |title, reports|
             x.p p, :style => "width: 40em"
           end
         elsif text.strip.empty?
-          x.p {x.em 'A report was expected, but not received'}
+          if report.subtitle and not report.subtitle.empty?
+            x.p {x.em 'Discussion Item with no text or minutes'}
+          else
+            x.p {x.em 'A report was expected, but not received'}
+          end
         end
       elsif report.text.strip.empty?
         x.p {x.em 'A report was expected, but not received'}
@@ -892,7 +944,7 @@ page = layout do |x|
       end
     end
   end
-  x.h2 "Other Attachments and Special Orders", :id => 'other'
+  x.h2 "Other Attachments, Special Orders, and Discussions", :id => 'other'
   x.ul do
     other = {}
     agenda.each do |title, reports|
diff --git a/www/board/agenda/views/actions/summary.json.rb 
b/www/board/agenda/views/actions/summary.json.rb
index 035c7e3..74d2f15 100644
--- a/www/board/agenda/views/actions/summary.json.rb
+++ b/www/board/agenda/views/actions/summary.json.rb
@@ -2,6 +2,7 @@
 header, body = @text.untaint.split(/\r?\n\r?\n/, 2)
 header.gsub! /\r?\n/, "\r\n"
 
+ASF::Mail.configure
 mail = Mail.new("#{header}\r\n\r\n#{body}")
 mail.deliver!
 

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

Reply via email to