-
Notifications
You must be signed in to change notification settings - Fork 5
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
Use character set instead of regex for string sanitizer #46
Conversation
What about some tests to confirm these changes work? |
@adamyanalunas how about now? |
|
||
@implementation NSString (AYLSanitizedForMetric) | ||
|
||
- (NSString *)ayl_sanitizedForMetric |
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.
Why not something like lib_santizedForMetric
(Librato) or lm_sanitizedForMetric
(Librato Metric) or alm_santizedForMetric
(Amco Librato Metric)?
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.
I tried to avoid two letter prefix. AYL was choosen by your initials and L for librato. But can rename to any other.
@@ -57,6 +57,7 @@ | |||
71FE433FB985CA1AB0DF6BDA /* Pods-librato-iOS Demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-librato-iOS Demo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-librato-iOS Demo/Pods-librato-iOS Demo.debug.xcconfig"; sourceTree = "<group>"; }; | |||
B3CFB32942D9D0C3245EEB4E /* Pods-librato-iOS Demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-librato-iOS Demo.release.xcconfig"; path = "Pods/Target Support Files/Pods-librato-iOS Demo/Pods-librato-iOS Demo.release.xcconfig"; sourceTree = "<group>"; }; | |||
C5A2D3C7197B48C6A9ACC07D /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; | |||
D9263DD61DB946660035CC6E /* NSString+AULSanitizedForMetricTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+AULSanitizedForMetricTests.m"; sourceTree = "<group>"; }; |
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.
Did you mean "AUL" to be "AYL"? If so, same questions about naming.
@adamyanalunas how about now? |
When I run the tests it looks like nothing happens. I set a breakpoint in
|
@adamyanalunas sorry for this, fixed. |
This address issue #45
Seems like regex do not replace all characters. Here is an example:
Explicit set is used to avoid non latin letters or symbols like
åß^
@adamyanalunas please inspect