-
Notifications
You must be signed in to change notification settings - Fork 50
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
Upcase body before searching to find lowercase tracking numbers #85
Conversation
The regexps define the search pattern in terms of uppercase characters, so when the source data you're searching contains lowercase tracking numbers, they don't match. By upcasing the body before searching, it's more likely to match the search patterns. This also matches that initializing a new `TrackingNumber` object upcases the number for its internal value. Inspired by: jkeen/tracking_number_data#102 Meant as an interim solution until it's decided whether the source regexps should be case-sensitive or not.
WalkthroughThe recent changes enhance the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- lib/tracking_number/base.rb (1 hunks)
- test/tracking_number_test.rb (2 hunks)
Additional comments not posted (2)
test/tracking_number_test.rb (1)
44-47
: New test case for lowercase tracking numbers is effective.The addition of this test case ensures that the
TrackingNumber.search
method correctly handles lowercase tracking numbers, enhancing test coverage and robustness.lib/tracking_number/base.rb (1)
27-27
: Modification to handle case insensitivity is well-implemented.Converting the
body
to uppercase before regex processing ensures that thescan
method can handle tracking numbers in any case, improving robustness.
@cgunther Thanks! A new version is getting cut and released right now 🤖 |
## [2.0.1](v2.0.0...v2.0.1) (2024-08-20) ### Bug Fixes * upcase body before searching to find lowercase tracking numbers ([#85](#85)) ([e07c754](e07c754))
🎉 This PR is included in version 2.0.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Thanks for the quick merge/release. For anyone else who stumbles on this, if your goal was to take a string like |
The regexps define the search pattern in terms of uppercase characters, so when the source data you're searching contains lowercase tracking numbers, they don't match.
By upcasing the body before searching, it's more likely to match the search patterns.
This also matches that initializing a new
TrackingNumber
object upcases the number for its internal value.Inspired by:
jkeen/tracking_number_data#102
Meant as an interim solution until it's decided whether the source regexps should be case-sensitive or not.
Summary by CodeRabbit
New Features
Tests