From 98aa080df29b3ccc26bbe6bdcbfd6bbcda870ff4 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 29 Oct 2019 07:48:58 +0000 Subject: dtas-console: pass kwargs as-is to String#encode Ruby 2.7.0dev will warn when hashes are passed and intended for use as kwargs unless we expand the hash via "**enc_opts", but "**" is Ruby 2.0+ syntax and I guess we still support 1.9.3 for the time being. --- bin/dtas-console | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin/dtas-console') diff --git a/bin/dtas-console b/bin/dtas-console index 877c9c4..2143e65 100755 --- a/bin/dtas-console +++ b/bin/dtas-console @@ -119,7 +119,6 @@ end pre_mute_vol = 1.0 enc_locale = Encoding.find("locale") $stdout.set_encoding(enc_locale) -enc_opts = { undef: :replace, invalid: :replace, replace: '?' } begin Curses.init_screen Curses.nonl @@ -165,7 +164,8 @@ begin # FS encoding != locale encoding, but we need to display an FS path # name to whatever locale the terminal is encoded to, so force it # and risk mojibake... - infile.encode(enc_locale, enc_opts) + infile.encode(enc_locale, + undef: :replace, invalid: :replace, replace: '?') Curses.setpos(lineno += 1, 0) Curses.clrtoeol Curses.addstr(infile) -- cgit v1.2.3-24-ge0c7