[前][次][番号順一覧][スレッド一覧]

ruby-changes:59661

From: Jeremy <ko1@a...>
Date: Fri, 10 Jan 2020 06:11:11 +0900 (JST)
Subject: [ruby-changes:59661] d3b28ebc7a (master): Fix warnings for URI.encode and URI.decode

https://git.ruby-lang.org/ruby.git/commit/?id=d3b28ebc7a

From d3b28ebc7ac527724831a9fb9ec2f963235f9a21 Mon Sep 17 00:00:00 2001
From: Jeremy Evans <code@j...>
Date: Thu, 9 Jan 2020 13:09:06 -0800
Subject: Fix warnings for URI.encode and URI.decode

Use __callee__ to display the called method.

Fixes [Bug #16469]

diff --git a/lib/uri/common.rb b/lib/uri/common.rb
index b886923..e3ed405 100644
--- a/lib/uri/common.rb
+++ b/lib/uri/common.rb
@@ -99,7 +99,7 @@ module URI https://github.com/ruby/ruby/blob/trunk/lib/uri/common.rb#L99
     #   # => "@%3F@%21"
     #
     def escape(*arg)
-      warn "URI.escape is obsolete", uplevel: 1
+      warn "URI.#{__callee__} is obsolete", uplevel: 1
       DEFAULT_PARSER.escape(*arg)
     end
     alias encode escape
@@ -130,7 +130,7 @@ module URI https://github.com/ruby/ruby/blob/trunk/lib/uri/common.rb#L130
     #   # => "http://example.com/?a=\t\r"
     #
     def unescape(*arg)
-      warn "URI.unescape is obsolete", uplevel: 1
+      warn "URI.#{__callee__} is obsolete", uplevel: 1
       DEFAULT_PARSER.unescape(*arg)
     end
     alias decode unescape
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]