Skip to content
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

MONGOID-5674 [Monkey Patch Removal] Remove Object#regexp? #5714

Merged

Conversation

johnnyshields
Copy link
Contributor

@johnnyshields johnnyshields commented Sep 4, 2023

Fixes MONGOID-5674

Object#regexp? is a trivial kernel monkey patch which returns true for Regexp and BSON::Regexp::Raw, and false for all else, including BSON::Regexp.

Because it is used by other monkey patch methods (on String) which cannot be easily removed, for now I have moved it to a private monkey patch String#__regexp?(object). This will be a stepping stone to further refactoring. I've also added additional tests for the two methods on String where it is used (the BSON::Regexp::Raw case was missing.) No tests are added for any private methods.

Overall progress is tracked here: http://tinyurl.com/mongoid-monkey. Refer to MONGOID-5660 for context.

@johnnyshields johnnyshields changed the title [Monkey Patch Removal] Remove Object#regexp? MONGOID-5675 [Monkey Patch Removal] Remove Object#regexp? Sep 4, 2023
@johnnyshields johnnyshields changed the title MONGOID-5675 [Monkey Patch Removal] Remove Object#regexp? MONGOID-5674 [Monkey Patch Removal] Remove Object#regexp? Sep 4, 2023
@jamis jamis merged commit 3e2dd93 into mongodb:master Nov 8, 2023
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants