Skip to content

Commit 2a97b47

Browse files
committed
Warn deprecated old constants
1 parent dada600 commit 2a97b47

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

lib/net/http/backward.rb

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,36 @@
55

66
class Net::HTTP
77
ProxyMod = ProxyDelta
8-
end
9-
10-
module Net
11-
HTTPSession = Net::HTTP
8+
deprecate_constant :ProxyMod
129
end
1310

1411
module Net::NetPrivate
1512
HTTPRequest = ::Net::HTTPRequest
13+
deprecate_constant :HTTPRequest
1614
end
1715

18-
Net::HTTPInformationCode = Net::HTTPInformation
19-
Net::HTTPSuccessCode = Net::HTTPSuccess
20-
Net::HTTPRedirectionCode = Net::HTTPRedirection
21-
Net::HTTPRetriableCode = Net::HTTPRedirection
22-
Net::HTTPClientErrorCode = Net::HTTPClientError
23-
Net::HTTPFatalErrorCode = Net::HTTPClientError
24-
Net::HTTPServerErrorCode = Net::HTTPServerError
25-
Net::HTTPResponseReceiver = Net::HTTPResponse
26-
2716
module Net
17+
HTTPSession = HTTP
18+
19+
HTTPInformationCode = HTTPInformation
20+
HTTPSuccessCode = HTTPSuccess
21+
HTTPRedirectionCode = HTTPRedirection
22+
HTTPRetriableCode = HTTPRedirection
23+
HTTPClientErrorCode = HTTPClientError
24+
HTTPFatalErrorCode = HTTPClientError
25+
HTTPServerErrorCode = HTTPServerError
26+
HTTPResponseReceiver = HTTPResponse
27+
2828
HTTPResponceReceiver = HTTPResponse # Typo since 2001
29-
deprecate_constant :HTTPResponceReceiver
29+
30+
deprecate_constant :HTTPSession,
31+
:HTTPInformationCode,
32+
:HTTPSuccessCode,
33+
:HTTPRedirectionCode,
34+
:HTTPRetriableCode,
35+
:HTTPClientErrorCode,
36+
:HTTPFatalErrorCode,
37+
:HTTPServerErrorCode,
38+
:HTTPResponseReceiver,
39+
:HTTPResponceReceiver
3040
end

0 commit comments

Comments
 (0)