You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2022/04/22 13:51:34 UTC

[whimsy] branch master updated: Ensure code works with any number of _ chars

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 23d55d3f Ensure code works with any number of _ chars
23d55d3f is described below

commit 23d55d3fa42c5392515dfe6224b10f5dcac3b288
Author: Sebb <se...@apache.org>
AuthorDate: Fri Apr 22 14:51:27 2022 +0100

    Ensure code works with any number of _ chars
---
 www/roster/views/actions/memstat.json.rb | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/www/roster/views/actions/memstat.json.rb b/www/roster/views/actions/memstat.json.rb
index 8fe8c25e..39e72989 100644
--- a/www/roster/views/actions/memstat.json.rb
+++ b/www/roster/views/actions/memstat.json.rb
@@ -73,16 +73,12 @@ elsif @action == 'request_emeritus'
   raise "Failed to read emeritus-request.txt: " + code unless code == "200"
   centered_id = USERID.center(55, '_')
   centered_name = USERNAME.center(55, '_')
-  centered_date = TIMESTAMP.center(55, '_')
+  centered_date = TIMESTAMP.center(25, '_')
   signed_request = template
-    .gsub('Apache id: _______________________________________________________',
-        ('Apache id: ' + centered_id))
-    .gsub('Full name: _______________________________________________________',
-          ('Full name: ' + centered_name))
-    .gsub('Signed: __________________________________________________________',
-          'Signed by validated user at: ________Whimsy www/committer_________')
-    .gsub('Date: _________________________________',
-          ('Date: _______' + centered_date))
+    .sub(/Apache id: _+/, ('Apache id: ' + centered_id))
+    .sub(/Full name: _+/, ('Full name: ' + centered_name))
+    .sub(/Signed: _+/, 'Signed by validated user at: ________Whimsy www/committer_________')
+    .sub(/Date: _+/, ('Date: ' + centered_date))
   # Write the emeritus request to emeritus-requests-received
   EMERITUS_REQUEST_URL = ASF::SVN.svnpath!('emeritus-requests-received')
   rc = ASF::SVN.create_(EMERITUS_REQUEST_URL, "#{USERID}.txt", signed_request, "Emeritus request from #{USERNAME} (#{USERID})", env, _)