about summary refs log tree commit homepage
path: root/bin
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-10-29 07:48:58 +0000
committerEric Wong <e@80x24.org>2019-11-02 19:34:29 +0000
commit98aa080df29b3ccc26bbe6bdcbfd6bbcda870ff4 (patch)
tree69607dcc784cca647fac7b47ac9bbb71f0f92c86 /bin
parentedc40e37184defcdae7c196e80ca6d068a3f808e (diff)
downloaddtas-98aa080df29b3ccc26bbe6bdcbfd6bbcda870ff4.tar.gz
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.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/dtas-console4
1 files changed, 2 insertions, 2 deletions
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)