You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2016/06/16 15:08:40 UTC

[whimsy] branch master updated: rough in logic to establish a new PMC

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

rubys pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git

The following commit(s) were added to refs/heads/master by this push:
       new  434c738   rough in logic to establish a new PMC
434c738 is described below

commit 434c738093e1c36810ddeeb1452550d40bf29f59
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Thu Jun 16 11:08:22 2016 -0400

    rough in logic to establish a new PMC
---
 lib/whimsy/asf/committee.rb | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/lib/whimsy/asf/committee.rb b/lib/whimsy/asf/committee.rb
index 9a5dfea..6c6b63b 100644
--- a/lib/whimsy/asf/committee.rb
+++ b/lib/whimsy/asf/committee.rb
@@ -60,6 +60,34 @@ module ASF
       parse_committee_info File.read(file)
     end
 
+    # insert (replacing if necessary) a new committee
+    def self.establish(contents, pmc, date, people)
+      # split into foot, sections (array) and head
+      foot = contents[/^=+\s*\Z/]
+      contents.sub! /^=+\s*\Z/, ''
+      sections = contents.split(/^\* /)
+      head = sections.shift
+
+      # remove existing section (if present)
+      sections.delete_if {|section| section.downcase.start_with? pmc.downcase}
+
+      # build new section
+      section  = ["#{pmc}  (est. #{date.strftime('%m/%Y')})"]
+      people.sort.each do |id, name|
+        name = "#{name.ljust(26)} <#{...@apache.org>"
+        section << "    #{(name).ljust(59)} [#{date.strftime('%Y-%m-%d')}]"
+      end
+
+      # add new section
+      sections << section.join("\n") + "\n\n\n"
+
+      # sort sections
+      sections.sort_by!(&:downcase)
+
+      # re-attach parts
+      head + '* ' + sections.join('* ') + foot
+    end
+
     def self.parse_committee_info(contents)
       list = Hash.new {|hash, name| hash[name] = find(name)}
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].