aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2024-07-18 13:16:20 +0900
committergit <svn-admin@ruby-lang.org>2024-07-19 00:50:37 +0000
commit082335494b59557c322617ff4329c5102cf404da (patch)
treeeab0adabf13a892bc6e80623119b73146c6cf4bd /lib
parent2a56c1841dcecc793ae9cbd0935643639eec1066 (diff)
downloadruby-082335494b59557c322617ff4329c5102cf404da.tar.gz
[ruby/uri] Added test for constant definition and remove URI::REGEXP when using RFC3986_PARSER
https://github.com/ruby/uri/commit/6f616d97fc
Diffstat (limited to 'lib')
-rw-r--r--lib/uri/common.rb3
1 files changed, 2 insertions, 1 deletions
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)