New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always issue deprecation warning when calling Regexp.new with 3rd positional argument #6976
Merged
jeremyevans
merged 1 commit into
ruby:master
from
jeremyevans:regexp.new-3rd-argument-deprecation-18797
Dec 22, 2022
Merged
Always issue deprecation warning when calling Regexp.new with 3rd positional argument #6976
jeremyevans
merged 1 commit into
ruby:master
from
jeremyevans:regexp.new-3rd-argument-deprecation-18797
Dec 22, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nobu
reviewed
Dec 21, 2022
nobu
reviewed
Dec 21, 2022
nobu
reviewed
Dec 21, 2022
jeremyevans
force-pushed
the
regexp.new-3rd-argument-deprecation-18797
branch
2 times, most recently
from
December 21, 2022 19:55
7d74d43
to
5de4cce
Compare
nobu
reviewed
Dec 22, 2022
test/ruby/test_regexp.rb
Outdated
assert_equal(Encoding.find("US-ASCII"), Regexp.new("b..", nil, "n").encoding) | ||
assert_equal("bar", "foobarbaz"[Regexp.new("b..", nil, "n")]) | ||
assert_equal(//n, Regexp.new("", nil, "n")) | ||
|
||
arg_encoding_none = 32 # ARG_ENCODING_NONE is implementation defined value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
arg_encoding_none = 32 # ARG_ENCODING_NONE is implementation defined value | |
arg_encoding_none = //n.options # ARG_ENCODING_NONE is implementation defined value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I committed this suggestion when I rebased.
…itional argument Previously, only certain values of the 3rd argument triggered a deprecation warning. First step for fix for bug #18797. Support for the 3rd argument will be removed after the release of Ruby 3.2. Fix minor fallout discovered by the tests. Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
jeremyevans
force-pushed
the
regexp.new-3rd-argument-deprecation-18797
branch
from
December 22, 2022 18:47
5de4cce
to
f225cb4
Compare
koic
added a commit
to koic/cookiejar
that referenced
this pull request
Feb 18, 2023
Follow up ruby/ruby#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 ```
yahonda
pushed a commit
to yahonda/cookiejar
that referenced
this pull request
Mar 27, 2023
Follow up ruby/ruby#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 ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, only certain values of the 3rd argument triggered a deprecation warning.
First step for fix for bug #18797. Support for the 3rd argument will be removed after the release of Ruby 3.2.
Fix minor fallout discovered by the tests.