ruby-changes:52613
From: nobu <ko1@a...>
Date: Mon, 24 Sep 2018 22:04:45 +0900 (JST)
Subject: [ruby-changes:52613] nobu:r64825 (trunk): Kernel#warn accepts multiple messages
nobu 2018-09-24 22:04:40 +0900 (Mon, 24 Sep 2018) New Revision: 64825 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64825 Log: Kernel#warn accepts multiple messages Modified files: trunk/lib/rubygems/core_ext/kernel_warn.rb Index: lib/rubygems/core_ext/kernel_warn.rb =================================================================== --- lib/rubygems/core_ext/kernel_warn.rb (revision 64824) +++ lib/rubygems/core_ext/kernel_warn.rb (revision 64825) @@ -7,14 +7,14 @@ if RUBY_VERSION >= "2.5" https://github.com/ruby/ruby/blob/trunk/lib/rubygems/core_ext/kernel_warn.rb#L7 Module.new {define_method(:warn, original_warn)} original_warn = method(:warn) - module_function define_method(:warn) {|message, uplevel: nil| + module_function define_method(:warn) {|*messages, uplevel: nil| if uplevel while (loc, = caller_locations(uplevel, 1); loc && loc.path.start_with?(path)) uplevel += 1 end - original_warn.call(message, uplevel: uplevel + 1) + original_warn.call(*messages, uplevel: uplevel) else - original_warn.call(message) + original_warn.call(*messages) end } end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/