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 89b24f36 Ignore some Ruby warnings
89b24f36 is described below

commit 89b24f36efee2a78a026233b3982d811f3065096
Author: Sebb <s...@apache.org>
AuthorDate: Fri Jan 5 17:05:51 2024 +0000

    Ignore some Ruby warnings
---
 www/status/monitors/public_json.rb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/www/status/monitors/public_json.rb 
b/www/status/monitors/public_json.rb
index 5ae89c5a..27545832 100644
--- a/www/status/monitors/public_json.rb
+++ b/www/status/monitors/public_json.rb
@@ -45,6 +45,10 @@ def Monitor.public_json(previous_status)
       # Ignore Wunderbar logging for normal messages (may occur multiple times)
       contents.gsub!(/^(_INFO|_DEBUG) .*?\n+/, '')
 
+      # Ignore Ruby warnings, e.g.:
+      # /usr/lib/ruby/2.7.0/net/protocol.rb:66: warning: previous definition 
of ProtocRetryError was here
+      contents.gsub!(%r{^(/usr|/var)\S+\.rb:\d+: warning: .*\n}, '')
+
       # diff -u output: (may have additional \n at end)
       if contents.gsub!(/^--- .*?\n\n?(\n|\Z)/m, '')
         status[name].merge! level: 'info', title: 'updated'
@@ -136,7 +140,7 @@ def Monitor.public_json(previous_status)
   {data: status}
 end
 
-# for debugging purposes
+# for debugging purposes; must be run from www/status currently
 if __FILE__ == $0
   require_relative 'unit_test'
   runtest('public_json') # must agree with method name above

Reply via email to