diff --git a/lib/uri/common.rb b/lib/uri/common.rb index 8542c51..cf93fb1 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -46,9 +46,9 @@ def self.parser=(parser = RFC3986_PARSER) self.parser = RFC3986_PARSER def self.const_missing(const) - if RFC2396_PARSER.regexp[const] + if value = RFC2396_PARSER.regexp[const] warn "URI::#{const} is obsolete. Use RFC2396_PARSER.regexp[#{const.inspect}] explicitly.", uplevel: 1 if $VERBOSE - RFC2396_PARSER.regexp[const] + value else super end