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 2017/09/27 13:44:08 UTC

[whimsy] branch master updated: make posting a new agenda work

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 054d800  make posting a new agenda work
054d800 is described below

commit 054d80058898bd1056bfdf8100298373507c40b3
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Wed Sep 27 09:43:45 2017 -0400

    make posting a new agenda work
---
 www/board/agenda/data/agenda.erb  |  2 +-
 www/board/agenda/models/agenda.rb |  2 +-
 www/board/agenda/routes.rb        | 11 +++++++----
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/www/board/agenda/data/agenda.erb b/www/board/agenda/data/agenda.erb
index 8499a66..02bf293 100644
--- a/www/board/agenda/data/agenda.erb
+++ b/www/board/agenda/data/agenda.erb
@@ -216,7 +216,7 @@ ASF::Committee.find('Security Team').chair.public_name %>]
 <% @pmcs.zip('A'..'ZZ').each do |pmc, index| %>
 -----------------------------------------
 Attachment <%= index %>: Report from the Apache <%= 
-pmc.display_name %> Project  [<%= pmc.chair.public_name %>] 
+pmc.display_name %> Project  [<%= pmc.chair.public_name %>]
 
 
 <% end %>
diff --git a/www/board/agenda/models/agenda.rb b/www/board/agenda/models/agenda.rb
index 5587fb6..ab9bb17 100755
--- a/www/board/agenda/models/agenda.rb
+++ b/www/board/agenda/models/agenda.rb
@@ -88,7 +88,7 @@ class Agenda
     file.untaint if file =~ /\Aboard_\w+_[\d_]+\.txt\z/
     path = File.expand_path(file, FOUNDATION_BOARD).untaint
     
-    return unless File.exist? path
+    return Agenda[file][:parsed] unless File.exist? path
 
     # Does the working copy have more recent data?
     working_copy = File.join(AGENDA_WORK, file)
diff --git a/www/board/agenda/routes.rb b/www/board/agenda/routes.rb
index b755dd3..dd74ad6 100755
--- a/www/board/agenda/routes.rb
+++ b/www/board/agenda/routes.rb
@@ -362,14 +362,17 @@ end
 post %r{/(\d\d\d\d-\d\d-\d\d)/} do |date|
   board = 'https://svn.apache.org/repos/private/foundation/board'
   agenda = "board_agenda_#{date.gsub('-', '_')}.txt"
-  auth = "--user #{env.user} --password #{env.password}"
+  auth = "--username #{env.user} --password #{env.password}"
+
+  contents = params[:agenda].gsub("\r\n", "\n")
 
   Dir.mktmpdir do |dir|
-    `svn checkout --depth empty #{dir} #{auth}`
-    File.write "#{dir}/#{agenda}", params[:agenda]
+    `svn checkout --depth empty #{board} #{dir} #{auth}`
+    File.write "#{dir}/#{agenda}", contents
     `svn add #{dir}/#{agenda}`
     `svn commit #{dir}/#{agenda} -message "Post #{date} agenda" #{auth}`
+    Agenda.update_cache agenda, File.join(dir, agenda), contents, false
   end
 
-  redirect to('/')
+  redirect to("/#{date}/")
 end

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