diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-11-03 19:23:44 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-11-04 20:51:51 +0900 |
commit | 3d8e1ee40f4aa780243458ee0e527807b948c8fd (patch) | |
tree | ab2c4a16330c63ac9fa37557a0136c0b7a9e89b7 /lib/net/http | |
parent | b49dbe025f27a5024c579d3b690833ae8943d71d (diff) |
[ruby/net-http] Warn deprecated old constants
https://github.com/ruby/net-http/commit/2a97b4729b
Diffstat (limited to 'lib/net/http')
-rw-r--r-- | lib/net/http/backward.rb | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/lib/net/http/backward.rb b/lib/net/http/backward.rb index 315ed58e62..691e41e4f1 100644 --- a/lib/net/http/backward.rb +++ b/lib/net/http/backward.rb @@ -5,26 +5,36 @@ 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 |