From eb512c5a9530322280991441954b0405cadeebf1 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 13 Dec 2019 21:38:50 +0900 Subject: [PATCH] warn should be a global function --- lib/rubygems/core_ext/kernel_warn.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rubygems/core_ext/kernel_warn.rb b/lib/rubygems/core_ext/kernel_warn.rb index 6ea72b10c3..dfc577df0b 100644 --- a/lib/rubygems/core_ext/kernel_warn.rb +++ b/lib/rubygems/core_ext/kernel_warn.rb @@ -16,7 +16,7 @@ if RUBY_VERSION >= "2.5" end - define_method(:warn) do |*messages, **kw| + module_function define_method(:warn) {|*messages, **kw| unless uplevel = kw[:uplevel] if Gem.java_platform? return original_warn.call(*messages) @@ -50,6 +50,6 @@ if RUBY_VERSION >= "2.5" kw[:uplevel] = uplevel original_warn.call(*messages, **kw) - end + } end end