Skip to content

Commit 9997c1a

Browse files
committed
Warn compatibility methods in RFC3986_PARSER
1 parent c2fdec0 commit 9997c1a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/uri/rfc3986_parser.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,19 @@ def extract(str, schemes = nil, &block) # :nodoc:
147147

148148
# Compatibility for RFC2396 parser
149149
def make_regexp(schemes = nil) # :nodoc:
150+
warn "URI::RFC3986_PARSER.make_regexp is obsoleted. Use URI::RFC2396_PARSER.make_regexp explicitly.", uplevel: 1 if $VERBOSE
150151
RFC2396_PARSER.make_regexp(schemes)
151152
end
152153

153154
# Compatibility for RFC2396 parser
154155
def escape(str, unsafe = nil) # :nodoc:
156+
warn "URI::RFC3986_PARSER.escape is obsoleted. Use URI::RFC2396_PARSER.escape explicitly.", uplevel: 1 if $VERBOSE
155157
unsafe ? RFC2396_PARSER.escape(str, unsafe) : RFC2396_PARSER.escape(str)
156158
end
157159

158160
# Compatibility for RFC2396 parser
159161
def unescape(str, escaped = nil) # :nodoc:
162+
warn "URI::RFC3986_PARSER.unescape is obsoleted. Use URI::RFC2396_PARSER.unescape explicitly.", uplevel: 1 if $VERBOSE
160163
escaped ? RFC2396_PARSER.unescape(str, escaped) : RFC2396_PARSER.unescape(str)
161164
end
162165

0 commit comments

Comments
 (0)