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

ruby-changes:69582

From: Nobuyoshi <ko1@a...>
Date: Thu, 4 Nov 2021 20:53:16 +0900 (JST)
Subject: [ruby-changes:69582] 3d8e1ee40f (master): [ruby/net-http] Warn deprecated old constants

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

From 3d8e1ee40f4aa780243458ee0e527807b948c8fd Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 3 Nov 2021 19:23:44 +0900
Subject: [ruby/net-http] Warn deprecated old constants

https://github.com/ruby/net-http/commit/2a97b4729b
---
 lib/net/http/backward.rb | 38 ++++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 14 deletions(-)

diff --git a/lib/net/http/backward.rb b/lib/net/http/backward.rb
index 315ed58e622..691e41e4f10 100644
--- a/lib/net/http/backward.rb
+++ b/lib/net/http/backward.rb
@@ -5,26 +5,36 @@ https://github.com/ruby/ruby/blob/trunk/lib/net/http/backward.rb#L5
 
 class Net::HTTP
   ProxyMod = ProxyDelta
-end
-
-module Net
-  HTTPSession = Net::HTTP
+  deprecate_constant :ProxyMod
 end
 
 module Net::NetPrivate
   HTTPRequest = ::Net::HTTPRequest
+  deprecate_constant :HTTPRequest
 end
 
-Net::HTTPInformationCode  = Net::HTTPInformation
-Net::HTTPSuccessCode      = Net::HTTPSuccess
-Net::HTTPRedirectionCode  = Net::HTTPRedirection
-Net::HTTPRetriableCode    = Net::HTTPRedirection
-Net::HTTPClientErrorCode  = Net::HTTPClientError
-Net::HTTPFatalErrorCode   = Net::HTTPClientError
-Net::HTTPServerErrorCode  = Net::HTTPServerError
-Net::HTTPResponseReceiver = Net::HTTPResponse
-
 module Net
+  HTTPSession = HTTP
+
+  HTTPInformationCode  = HTTPInformation
+  HTTPSuccessCode      = HTTPSuccess
+  HTTPRedirectionCode  = HTTPRedirection
+  HTTPRetriableCode    = HTTPRedirection
+  HTTPClientErrorCode  = HTTPClientError
+  HTTPFatalErrorCode   = HTTPClientError
+  HTTPServerErrorCode  = HTTPServerError
+  HTTPResponseReceiver = HTTPResponse
+
   HTTPResponceReceiver = HTTPResponse # Typo since 2001
-  deprecate_constant :HTTPResponceReceiver
+
+  deprecate_constant :HTTPSession,
+                     :HTTPInformationCode,
+                     :HTTPSuccessCode,
+                     :HTTPRedirectionCode,
+                     :HTTPRetriableCode,
+                     :HTTPClientErrorCode,
+                     :HTTPFatalErrorCode,
+                     :HTTPServerErrorCode,
+                     :HTTPResponseReceiver,
+                     :HTTPResponceReceiver
 end
-- 
cgit v1.2.1


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

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