diff --git a/mustermann/lib/mustermann/ast/translator.rb b/mustermann/lib/mustermann/ast/translator.rb index c6efc66..cee8d97 100644 --- a/mustermann/lib/mustermann/ast/translator.rb +++ b/mustermann/lib/mustermann/ast/translator.rb @@ -118,7 +118,7 @@ def decorator_for(node) # @return [String] escaped character # @!visibility private - def escape(char, parser: URI::RFC2396_PARSER, escape: URI::RFC2396_Parser.new.regexp[:UNSAFE], also_escape: nil) + def escape(char, parser: URI::RFC2396_PARSER, escape: URI::RFC2396_PARSER.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