sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 55f6b77ab6327495241e3c2ced6e33cb6ee8dd35
parent 9a1e80f558a8042df52997c254dc1b72d945de59
Author: Dan Callaghan <djc@djc.id.au>
Date:   Tue,  5 May 2020 11:10:04 +1000

accept and discard 'uplevel' argument in logging methods

In Ruby 2.7, URI#escape calls warn with a second argument uplevel: 1.
This was causing mismatched arguments in sup's monkey-patched logging
methods which redefine warn:

    --- ArgumentError from thread: main
    wrong number of arguments (given 2, expected 1)
    lib/sup/logger.rb:74:in `block (2 levels) in '
    /usr/share/ruby/uri/common.rb:102:in `escape'
    lib/sup/maildir.rb:19:in `initialize'
    [...]

Diffstat:
M lib/sup/logger.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/sup/logger.rb b/lib/sup/logger.rb
@@ -71,7 +71,7 @@ end
 
 ## include me to have top-level #debug, #info, etc. methods.
 module LogsStuff
-  Logger::LEVELS.each { |l| define_method(l) { |s| Logger.instance.send(l, s) } }
+  Logger::LEVELS.each { |l| define_method(l) { |s, uplevel = 0| Logger.instance.send(l, s) } }
 end
 
 end