Skip to content

Commit 428eb10

Browse files
committed
Use a fully qualified name in warning messages
Currently, some warning messages don't contain a `URI` like the following. ```ruby warning: URI::ABS_URI is obsolete. Use RFC2396_PARSER.regexp[:ABS_URI] explicitly. ``` But, without `URI` prefix, the suggested value doesn't work. So I think we should use a fully qualified name to avoid confusion.
1 parent ddabff4 commit 428eb10

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/uri/common.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ def self.const_missing(const) # :nodoc:
4949
warn "URI::REGEXP is obsolete. Use URI::RFC2396_REGEXP explicitly.", uplevel: 1 if $VERBOSE
5050
URI::RFC2396_REGEXP
5151
elsif value = RFC2396_PARSER.regexp[const]
52-
warn "URI::#{const} is obsolete. Use RFC2396_PARSER.regexp[#{const.inspect}] explicitly.", uplevel: 1 if $VERBOSE
52+
warn "URI::#{const} is obsolete. Use URI::RFC2396_PARSER.regexp[#{const.inspect}] explicitly.", uplevel: 1 if $VERBOSE
5353
value
5454
elsif value = RFC2396_Parser.const_get(const)
55-
warn "URI::#{const} is obsolete. Use RFC2396_Parser::#{const} explicitly.", uplevel: 1 if $VERBOSE
55+
warn "URI::#{const} is obsolete. Use URI::RFC2396_Parser::#{const} explicitly.", uplevel: 1 if $VERBOSE
5656
value
5757
else
5858
super

0 commit comments

Comments
 (0)