From 88132768075eeb19733d70659eeb18703ebe352d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Barri=C3=A9?= Date: Thu, 7 May 2020 15:12:16 -0400 Subject: [PATCH] Don't leak a global variable --- lib/coderay/scanners/ruby.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/coderay/scanners/ruby.rb b/lib/coderay/scanners/ruby.rb index 5b8de42f..a9a41149 100644 --- a/lib/coderay/scanners/ruby.rb +++ b/lib/coderay/scanners/ruby.rb @@ -257,7 +257,7 @@ def scan_tokens encoder, options end unless unicode # check for unicode - $DEBUG_BEFORE, $DEBUG = $DEBUG, false + debug_before, $DEBUG = $DEBUG, false begin if check(/./mu).size > 1 # seems like we should try again with unicode @@ -266,7 +266,7 @@ def scan_tokens encoder, options rescue # bad unicode char; use getch ensure - $DEBUG = $DEBUG_BEFORE + $DEBUG = debug_before end next if unicode end