From a73e526945179451d5b0f0b687838a94f9bbeb54 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Sat, 18 Feb 2023 02:27:20 +0900 Subject: [PATCH] Suppress deprecation warning for `Regexp.new` with 3rd argument Follow up https://github.com/ruby/ruby/pull/6976. This PR suppresses the following deprecation warning. ```console % ruby -v ruby 3.2.1 (2023-02-08 revision 31819e82c8) [x86_64-darwin19] % bundle exec rake (snip) /Users/koic/src/github.com/dwaite/cookiejar/lib/cookiejar/cookie_validation.rb:48: warning: 3rd argument to Regexp.new is deprecated and will be removed in Ruby 3.3; use 2nd argument instead ``` --- lib/cookiejar/cookie_validation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cookiejar/cookie_validation.rb b/lib/cookiejar/cookie_validation.rb index a64c607..b1f68ac 100644 --- a/lib/cookiejar/cookie_validation.rb +++ b/lib/cookiejar/cookie_validation.rb @@ -45,7 +45,7 @@ module PATTERN HDN = /\A#{PATTERN::HOSTNAME}\Z/ TOKEN = /\A#{PATTERN::TOKEN}\Z/ PARAM1 = /\A(#{PATTERN::TOKEN})(?:=#{PATTERN::VALUE1})?\Z/ - PARAM2 = Regexp.new "(#{PATTERN::TOKEN})(?:=(#{PATTERN::VALUE2}))?(?:\\Z|;)", '', 'n' + PARAM2 = Regexp.new "(#{PATTERN::TOKEN})(?:=(#{PATTERN::VALUE2}))?(?:\\Z|;)", Regexp::NOENCODING # TWO_DOT_DOMAINS = /\A\.(com|edu|net|mil|gov|int|org)\Z/ # Converts the input object to a URI (if not already a URI)