From f738eeabc251c556feda1f9f22c060dac85054e1 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 22 Jun 2019 23:38:07 +0900 Subject: [PATCH] golf_prelude.rb: suppress the redefining warning --- golf_prelude.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/golf_prelude.rb b/golf_prelude.rb index 204f659b0e..a13d3f71bc 100644 --- a/golf_prelude.rb +++ b/golf_prelude.rb @@ -1,6 +1,7 @@ class Object @@golf_hash = {} + verbose, $VERBOSE = $VERBOSE, nil def method_missing m, *a, &b t = @@golf_hash[ [m, self.class] ] ||= matching_methods(m)[0] if t && b @@ -12,6 +13,7 @@ class Object t ? __send__(t, *a, &b) : super end end + $VERBOSE = verbose def matching_methods(s = '', m = callable_methods) r = /^#{s.to_s.gsub(/./){"(.*?)" + Regexp.escape($&)}}/