whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: split out discussion items into separate items
Date Fri, 06 Apr 2018 18:24:35 GMT
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 24ee4fb  split out discussion items into separate items
24ee4fb is described below

commit 24ee4fb04613e2f4ad43b3abbef75ef41bb9202c
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Fri Apr 6 14:24:14 2018 -0400

    split out discussion items into separate items
---
 lib/whimsy/asf/agenda.rb            |  2 ++
 lib/whimsy/asf/agenda/back.rb       |  3 +--
 lib/whimsy/asf/agenda/discussion.rb | 42 +++++++++++++++++++++++++++++++++++++
 3 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/lib/whimsy/asf/agenda.rb b/lib/whimsy/asf/agenda.rb
index a894277..6027c32 100644
--- a/lib/whimsy/asf/agenda.rb
+++ b/lib/whimsy/asf/agenda.rb
@@ -26,6 +26,7 @@ class ASF::Board::Agenda
     'A'  => 'Committee Reports',
     '7A' => 'Special Orders',
     '8.' => 'Discussion Items',
+    '8A' => 'Discussion Items',
     '9.' => 'Action Items'
   }
 
@@ -190,5 +191,6 @@ require_relative 'agenda/exec-officer'
 require_relative 'agenda/attachments'
 require_relative 'agenda/committee'
 require_relative 'agenda/special'
+require_relative 'agenda/discussion'
 require_relative 'agenda/back'
 require_relative 'agenda/summary'
diff --git a/lib/whimsy/asf/agenda/back.rb b/lib/whimsy/asf/agenda/back.rb
index fca06a2..82b1320 100644
--- a/lib/whimsy/asf/agenda/back.rb
+++ b/lib/whimsy/asf/agenda/back.rb
@@ -1,5 +1,4 @@
 # Back sections:
-# * Discussion Items
 # * Review Outstanding Action Items
 # * Unfinished Business
 # * New Business
@@ -9,7 +8,7 @@
 class ASF::Board::Agenda
   parse do
     pattern = /
-      ^(?<attach>(?:\s[89]|\s9|1\d)\.)
+      ^(?<attach>(?:\s9|1\d)\.)
       \s(?<title>.*?)\n
       (?<text>.*?)
       (?=\n[\s1]\d\.|\n===)
diff --git a/lib/whimsy/asf/agenda/discussion.rb b/lib/whimsy/asf/agenda/discussion.rb
new file mode 100644
index 0000000..ab657d4
--- /dev/null
+++ b/lib/whimsy/asf/agenda/discussion.rb
@@ -0,0 +1,42 @@
+# 
+# Discussion Items
+#
+
+class ASF::Board::Agenda
+  parse do
+    discussion = @file.split(/^ \d. Discussion Items/,2).last.
+      split(/^ \d. .*Action Items/,2).first
+    
+    if discussion.strip.empty?
+
+      # One (empty) item for Discussion Items
+
+      pattern = /
+        ^(?<attach>\s[8]\.)
+        \s(?<title>.*?)\n
+        (?<text>.*?)
+        (?=\n[\s1]\d\.|\n===)
+      /mx
+
+      scan @file, pattern do |attrs|
+        attrs['attach'].strip!
+        attrs['prior_reports'] = minutes(attrs['title'])
+      end
+
+    else
+
+      # Separate items for each individual Discussion Item
+
+      pattern = /
+        \n+(?<indent>\s{3,5})(?<section>[A-Z])\.
+        \s(?<title>.*?)\n
+        (?<text>.*?)
+        (?=\n\s{4}[A-Z]\.\s|\z)
+      /mx
+
+      scan discussion, pattern do |attrs|
+        attrs['section'] = '8' + attrs['section'] 
+      end
+    end
+  end
+end

-- 
To stop receiving notification emails like this one, please contact
rubys@apache.org.

Mime
View raw message