@@ -30,6 +30,9 @@ def self.parser=(parser = RFC3986_PARSER)
3030 remove_const ( :Parser ) if defined? ( ::URI ::Parser )
3131 const_set ( "Parser" , parser . class )
3232
33+ remove_const ( :PARSER ) if defined? ( ::URI ::PARSER )
34+ const_set ( "PARSER" , parser )
35+
3336 remove_const ( :REGEXP ) if defined? ( ::URI ::REGEXP )
3437 remove_const ( :PATTERN ) if defined? ( ::URI ::PATTERN )
3538 if Parser == RFC2396_Parser
@@ -227,7 +230,7 @@ class BadURIError < Error; end
227230 # ["fragment", "top"]]
228231 #
229232 def self . split ( uri )
230- DEFAULT_PARSER . split ( uri )
233+ PARSER . split ( uri )
231234 end
232235
233236 # Returns a new \URI object constructed from the given string +uri+:
@@ -241,7 +244,7 @@ def self.split(uri)
241244 # if it may contain invalid URI characters.
242245 #
243246 def self . parse ( uri )
244- DEFAULT_PARSER . parse ( uri )
247+ PARSER . parse ( uri )
245248 end
246249
247250 # Merges the given URI strings +str+
@@ -297,7 +300,7 @@ def self.join(*str)
297300 #
298301 def self . extract ( str , schemes = nil , &block ) # :nodoc:
299302 warn "URI.extract is obsolete" , uplevel : 1 if $VERBOSE
300- DEFAULT_PARSER . extract ( str , schemes , &block )
303+ PARSER . extract ( str , schemes , &block )
301304 end
302305
303306 #
@@ -334,7 +337,7 @@ def self.extract(str, schemes = nil, &block) # :nodoc:
334337 #
335338 def self . regexp ( schemes = nil ) # :nodoc:
336339 warn "URI.regexp is obsolete" , uplevel : 1 if $VERBOSE
337- DEFAULT_PARSER . make_regexp ( schemes )
340+ PARSER . make_regexp ( schemes )
338341 end
339342
340343 TBLENCWWWCOMP_ = { } # :nodoc:
0 commit comments