From 9d2de68fea9ea8dec9c52b5cf7d2f9fdee5333a4 Mon Sep 17 00:00:00 2001 From: Tom Black Date: Sun, 6 Jan 2019 00:47:55 -0800 Subject: Silence uninitialized console variable warning --- lib/ruby2d/window.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ruby2d/window.rb b/lib/ruby2d/window.rb index a952134..9e8b462 100644 --- a/lib/ruby2d/window.rb +++ b/lib/ruby2d/window.rb @@ -87,7 +87,11 @@ module Ruby2D @diagnostics = false # Console mode, enabled at command line - @console = $ruby2d_console_mode || false + if RUBY_ENGINE == 'ruby' + @console = defined?($ruby2d_console_mode) ? true : false + else + @console = false + end end # Class methods for convenient access to properties -- cgit v1.2.3