Skip to content

Commit

Permalink
Removed duplicated declare step for constants under the URI::RFC2396_…
Browse files Browse the repository at this point in the history
…REGEXP::PATTERN
  • Loading branch information
hsbt committed Nov 13, 2024
1 parent ee9a387 commit 60a8bc1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 0 additions & 5 deletions lib/uri/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ def self.parser=(parser = RFC3986_PARSER)
if Parser == RFC2396_Parser
const_set("REGEXP", URI::RFC2396_REGEXP)
const_set("PATTERN", URI::RFC2396_REGEXP::PATTERN)
Parser.new.pattern.each_pair do |sym, str|
unless REGEXP::PATTERN.const_defined?(sym)
REGEXP::PATTERN.const_set(sym, str)
end
end
end

Parser.new.regexp.each_pair do |sym, str|
Expand Down
1 change: 1 addition & 0 deletions test/uri/test_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def test_parser_switch
assert defined?(URI::REGEXP)
assert defined?(URI::PATTERN)
assert defined?(URI::PATTERN::ESCAPED)
assert defined?(URI::REGEXP::PATTERN::IPV6ADDR)

URI.parser = URI::RFC3986_PARSER

Expand Down

0 comments on commit 60a8bc1

Please sign in to comment.