Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Removed duplicated declare step for constants under the URI::RFC2396_…
…REGEXP::PATTERN
  • Loading branch information
hsbt committed Nov 13, 2024
commit 60a8bc15759065762fda95e83f383747904089a8
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