From 082335494b59557c322617ff4329c5102cf404da Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 18 Jul 2024 13:16:20 +0900 Subject: [ruby/uri] Added test for constant definition and remove URI::REGEXP when using RFC3986_PARSER https://github.com/ruby/uri/commit/6f616d97fc --- lib/uri/common.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/uri/common.rb b/lib/uri/common.rb index 4515a77af6..a4ed70f9a3 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -26,8 +26,8 @@ module URI remove_const(:Parser) if defined?(Parser) const_set("Parser", parser.class) + remove_const(:REGEXP) if defined?(REGEXP) if Parser == RFC2396_Parser - remove_const(:REGEXP) if defined?(REGEXP) const_set("REGEXP", URI::RFC2396_REGEXP) Parser.new.pattern.each_pair do |sym, str| unless REGEXP::PATTERN.const_defined?(sym) @@ -35,6 +35,7 @@ module URI end end end + Parser.new.regexp.each_pair do |sym, str| remove_const(sym) if const_defined?(sym) const_set(sym, str) -- cgit v1.2.3