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 f8d077d  remove terminated projects from reporting cycle
f8d077d is described below

commit f8d077df9c976fa155db547b3f2fa2fd37188ecd
Author: Sam Ruby <[email protected]>
AuthorDate: Sun Mar 25 13:44:06 2018 -0400

    remove terminated projects from reporting cycle
---
 lib/whimsy/asf/committee.rb                  | 29 ++++++++++++++++++++++++++++
 www/board/agenda/views/actions/todos.json.rb |  5 +++++
 2 files changed, 34 insertions(+)

diff --git a/lib/whimsy/asf/committee.rb b/lib/whimsy/asf/committee.rb
index 0febcbc..bc1c563 100644
--- a/lib/whimsy/asf/committee.rb
+++ b/lib/whimsy/asf/committee.rb
@@ -220,6 +220,35 @@ module ASF
       contents
     end
 
+    # remove committee from committee-info.txt
+    def self.terminate(contents, pmc)
+      ########################################################################
+      #         remove from assigned quarterly reporting periods             #
+      ########################################################################
+
+      # split into blocks
+      blocks = contents.split("\n\n")
+
+      # find the reporting schedules
+      index =  blocks.find_index {|section| section =~/January/}
+
+      # remove from each reporting period 
+      blocks[index+0].sub! "\n    #{pmc}\n", "\n"
+      blocks[index+1].sub! "\n    #{pmc}\n", "\n"
+      blocks[index+2].sub! "\n    #{pmc}\n", "\n"
+
+      # re-attach blocks
+      contents = blocks.join("\n\n")
+
+      ########################################################################
+      #         remove from COMMITTEE MEMBERSHIP AND CHANGE PROCESS          #
+      ########################################################################
+
+      contents.sub! /^\* #{pmc}  \(est.*?\n\n/m, ''
+
+      contents
+    end
+
     # insert (replacing if necessary) a new committee into committee-info.txt
     def self.establish(contents, pmc, date, people)
       ########################################################################
diff --git a/www/board/agenda/views/actions/todos.json.rb 
b/www/board/agenda/views/actions/todos.json.rb
index 7510a29..75e9b37 100644
--- a/www/board/agenda/views/actions/todos.json.rb
+++ b/www/board/agenda/views/actions/todos.json.rb
@@ -82,6 +82,11 @@ if (@change || @establish || @terminate) and env.password
     # update chairs from establish, change, and terminate resolutions
     contents = ASF::Committee.update_chairs(contents, todos)
 
+    # remove terminated projects
+    Array(@terminate).each do |resolution|
+      contents = ASF::Committee.terminate(contents, resolution['display_name'])
+    end
+
     # add people from establish resolutions
     established = Date.parse(date.gsub('_', '-'))
     Array(@establish).each do |resolution|

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

Reply via email to