summaryrefslogtreecommitdiff
path: root/lib/uri/common.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/uri/common.rb')
-rw-r--r--lib/uri/common.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/uri/common.rb b/lib/uri/common.rb
index 904df10663..621353093d 100644
--- a/lib/uri/common.rb
+++ b/lib/uri/common.rb
@@ -46,9 +46,15 @@ module URI
self.parser = RFC3986_PARSER
def self.const_missing(const)
- if value = RFC2396_PARSER.regexp[const]
+ if const == :REGEXP
+ warn "URI::REGEXP is obsolete. Use URI::RFC2396_REGEXP explicitly.", uplevel: 1 if $VERBOSE
+ URI::RFC2396_REGEXP
+ elsif value = RFC2396_PARSER.regexp[const]
warn "URI::#{const} is obsolete. Use RFC2396_PARSER.regexp[#{const.inspect}] explicitly.", uplevel: 1 if $VERBOSE
value
+ elsif value = RFC2396_Parser.const_get(const)
+ warn "URI::#{const} is obsolete. Use RFC2396_Parser::#{const} explicitly.", uplevel: 1 if $VERBOSE
+ value
else
super
end