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

ruby-changes:57988

From: Jeremy <ko1@a...>
Date: Fri, 27 Sep 2019 23:43:57 +0900 (JST)
Subject: [ruby-changes:57988] 869e2dd8c8 (master): Warn for URI.{, un}{escape, encode}, even if not in verbose mode

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

From 869e2dd8c8efc1e7a043c9eee82d97c47befbcc7 Mon Sep 17 00:00:00 2001
From: Jeremy Evans <code@j...>
Date: Wed, 26 Jun 2019 13:20:22 -0700
Subject: Warn for URI.{,un}{escape,encode}, even if not in verbose mode

The verbose mode warning has been present for almost 10 years.
If we ever plan to remove these methods, we should make the warning
a regular deprecation warning so that people are aware.

Implements [Feature #15961]

diff --git a/lib/uri/common.rb b/lib/uri/common.rb
index 811ec98..b886923 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 if $VERBOSE
+      warn "URI.escape 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 if $VERBOSE
+      warn "URI.unescape 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/

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