Skip to content

Commit

Permalink
Use URI::RFC2396_Parser#regex explicitly.
Browse files Browse the repository at this point in the history
In background, URI will change DEFAULT_PARSER to RFC2396_Parser.

ruby/uri#107

After that, we lost some of regex pattern like UNSAFE.
  • Loading branch information
hsbt committed Jul 19, 2024
1 parent 56dc65e commit 0ed6aa3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mustermann/lib/mustermann/ast/translator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def decorator_for(node)

# @return [String] escaped character
# @!visibility private
def escape(char, parser: URI::DEFAULT_PARSER, escape: parser.regexp[:UNSAFE], also_escape: nil)
def escape(char, parser: URI::DEFAULT_PARSER, escape: URI::RFC2396_Parser.new.regexp[:UNSAFE], also_escape: nil)
escape = Regexp.union(also_escape, escape) if also_escape
char.to_s =~ escape ? parser.escape(char, Regexp.union(*escape)) : char
end
Expand Down

0 comments on commit 0ed6aa3

Please sign in to comment.