ruby-changes:56193
From: Nobuyoshi <ko1@a...>
Date: Sat, 22 Jun 2019 23:39:22 +0900 (JST)
Subject: [ruby-changes:56193] Nobuyoshi Nakada: f738eeabc2 (trunk): golf_prelude.rb: suppress the redefining warning
https://git.ruby-lang.org/ruby.git/commit/?id=f738eeabc2 From f738eeabc251c556feda1f9f22c060dac85054e1 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sat, 22 Jun 2019 23:38:07 +0900 Subject: golf_prelude.rb: suppress the redefining warning diff --git a/golf_prelude.rb b/golf_prelude.rb index 204f659..a13d3f7 100644 --- a/golf_prelude.rb +++ b/golf_prelude.rb @@ -1,6 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/golf_prelude.rb#L1 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 https://github.com/ruby/ruby/blob/trunk/golf_prelude.rb#L13 t ? __send__(t, *a, &b) : super end end + $VERBOSE = verbose def matching_methods(s = '', m = callable_methods) r = /^#{s.to_s.gsub(/./){"(.*?)" + Regexp.escape($&)}}/ -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/