whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Use shorthand id for accessing SVN
Date Tue, 01 May 2018 22:39:23 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb 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 da29495  Use shorthand id for accessing SVN
da29495 is described below

commit da29495dab3c0d3b23a4a15c91771b5fb0a5352c
Author: Sebb <sebb@apache.org>
AuthorDate: Tue May 1 23:39:22 2018 +0100

    Use shorthand id for accessing SVN
    
    Also use File.join instead of '/'
---
 www/board/agenda/views/actions/posted-reports.json.rb |  2 +-
 www/board/agenda/views/actions/todos.json.rb          | 10 +++++-----
 www/board/agenda/views/committers_report.text.rb      |  8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/www/board/agenda/views/actions/posted-reports.json.rb b/www/board/agenda/views/actions/posted-reports.json.rb
index 9409608..141733c 100755
--- a/www/board/agenda/views/actions/posted-reports.json.rb
+++ b/www/board/agenda/views/actions/posted-reports.json.rb
@@ -37,7 +37,7 @@ archive.each do |email|
 end
 
 # Get a list of missing board reports
-agendas = Dir["#{ASF::SVN['private/foundation/board']}/board_agenda_*.txt"]
+agendas = Dir[File.join(ASF::SVN['foundation_board'], 'board_agenda_*.txt')]
 parsed = ASF::Board::Agenda.parse(IO.read(agendas.sort.last.untaint), true)
 missing = parsed.select {|item| item['missing']}.
   map {|item| item['title'].downcase}
diff --git a/www/board/agenda/views/actions/todos.json.rb b/www/board/agenda/views/actions/todos.json.rb
index 75e9b37..c2196b6 100644
--- a/www/board/agenda/views/actions/todos.json.rb
+++ b/www/board/agenda/views/actions/todos.json.rb
@@ -10,7 +10,7 @@ agenda = "board_agenda_#{date}.txt"
 
 # fetch minutes
 @minutes = agenda.sub('_agenda_', '_minutes_')
-minutes_file = "#{AGENDA_WORK}/#{@minutes.sub('.txt', '.yml')}"
+minutes_file = File.join(AGENDA_WORK, "#{@minutes.sub('.txt', '.yml')}")
 minutes_file.untaint if @minutes =~ /^board_minutes_\d+_\d+_\d+\.txt$/
 
 if File.exist? minutes_file
@@ -59,7 +59,7 @@ end
 
 # update committee-info.txt
 if (@change || @establish || @terminate) and env.password
-  cinfo = "#{ASF::SVN['private/committers/board']}/committee-info.txt"
+  cinfo = File.join(ASF::SVN['board'], 'committee-info.txt')
 
   todos  = Array(@change) + Array(@establish) + Array(@terminate)
   if todos.length == 1
@@ -152,15 +152,15 @@ if @establish and env.password
 
   # create 'victims' file for tlpreq tool
   `svn up #{TLPREQ}`
-  establish -= Dir["#{TLPREQ}/victims-#{date}.*.txt"].
+  establish -= Dir[File.join(TLPREQ, 'victims-#{date}.*.txt')].
      map {|name| File.read(name.untaint).lines().map(&:chomp)}.flatten
   unless establish.empty?
-    count = Dir["#{TLPREQ}/victims-#{date}.*.txt"].length
+    count = Dir[File.join(TLPREQ, 'victims-#{date}.*.txt')].length
     message = "record #{date} approved TLP resolutions"
     ASF::SVN.update TLPREQ, message, env, _ do |tmpdir|
       filename = "victims-#{date}.#{count}.txt"
       contents = establish.join("\n") + "\n"
-      File.write "#{tmpdir}/#{filename}", contents
+      File.write File.join(tmpdir, filename), contents
       _.system "svn add #{tmpdir}/#{filename}"
     end
   end
diff --git a/www/board/agenda/views/committers_report.text.rb b/www/board/agenda/views/committers_report.text.rb
index 25c28c9..5504208 100644
--- a/www/board/agenda/views/committers_report.text.rb
+++ b/www/board/agenda/views/committers_report.text.rb
@@ -16,8 +16,8 @@ def prefixNumber(number)
   return number + "th"
 end
 
-board_svn = ASF::SVN['private/foundation/board']
-agenda_file = Dir["#{board_svn}/board_agenda_*.txt"].last.untaint
+board_svn = ASF::SVN['foundation_board']
+agenda_file = Dir[File.join(board_svn, 'board_agenda_*.txt')].last.untaint
 
 ##### Parse the agenda to find the data items above
 
@@ -154,7 +154,7 @@ end
 
 ##### 7: Find out the date of the next board report
 
-calendar_file  = ASF::SVN['private/committers/board'] + "/calendar.txt"
+calendar_file  = File.join(ASF::SVN['board'], 'calendar.txt')
 found_date = false
 next_meeting = nil
 File.open(calendar_file).each do |line|
@@ -191,7 +191,7 @@ end
 ## this does not work, since new TLPs are not yet in committee-info.txt
 ## instead we should parse this from the resolution
 
-committee_file = ASF::SVN['private/committers/board'] + "/committee-info.txt"
+committee_file = File.join(ASF::SVN['board'], 'committee-info.txt')
 parsing_projects = false
 resolution_to_chair = Hash.new
 File.open(committee_file).each do |line|

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

Mime
View raw message