Skip to content

Commit 2b3670f

Browse files
authored
Fix Regexp.new deprecated third argument usage (#2)
At least since ruby 2.7, passing 'n' code option to the third argument of Regexp.new is the same as specifying Regexp::NOENCODING to the second argument. Now with ruby 3.2, using third argument is declared deprecated, and with ruby 3.3, third argument support is removed: ruby/ruby#7039 To handle ruby 3.3, fix Regexp.new usage as above.
1 parent 511a1be commit 2b3670f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/cookiejar/cookie_validation.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module PATTERN
4545
HDN = /\A#{PATTERN::HOSTNAME}\Z/
4646
TOKEN = /\A#{PATTERN::TOKEN}\Z/
4747
PARAM1 = /\A(#{PATTERN::TOKEN})(?:=#{PATTERN::VALUE1})?\Z/
48-
PARAM2 = Regexp.new "(#{PATTERN::TOKEN})(?:=(#{PATTERN::VALUE2}))?(?:\\Z|;)", '', 'n'
48+
PARAM2 = Regexp.new "(#{PATTERN::TOKEN})(?:=(#{PATTERN::VALUE2}))?(?:\\Z|;)", Regexp::NOENCODING
4949
# TWO_DOT_DOMAINS = /\A\.(com|edu|net|mil|gov|int|org)\Z/
5050

5151
# Converts the input object to a URI (if not already a URI)

0 commit comments

Comments
 (0)