diff --git a/Demo/librato-iOS Demo.xcodeproj/project.pbxproj b/Demo/librato-iOS Demo.xcodeproj/project.pbxproj index 5e85e56..f1b30cc 100644 --- a/Demo/librato-iOS Demo.xcodeproj/project.pbxproj +++ b/Demo/librato-iOS Demo.xcodeproj/project.pbxproj @@ -57,7 +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 = ""; }; 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 = ""; }; C5A2D3C7197B48C6A9ACC07D /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; - D9263DD61DB946660035CC6E /* NSString+SanitizedForMetricTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+SanitizedForMetricTests.m"; sourceTree = ""; }; + D9263DD61DB946660035CC6E /* NSString+AULSanitizedForMetricTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+AULSanitizedForMetricTests.m"; sourceTree = ""; }; F8E7DC6EE1A84E81B6B7B7A2 /* libPods-librato-iOS Demo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-librato-iOS Demo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -148,7 +148,7 @@ isa = PBXGroup; children = ( 66922642180358B000237E77 /* librato_iOS_DemoTests.m */, - D9263DD61DB946660035CC6E /* NSString+SanitizedForMetricTests.m */, + D9263DD61DB946660035CC6E /* NSString+AULSanitizedForMetricTests.m */, 6692263D180358B000237E77 /* Supporting Files */, ); path = "librato-iOS DemoTests"; @@ -331,7 +331,6 @@ buildActionMask = 2147483647; files = ( 66922643180358B000237E77 /* librato_iOS_DemoTests.m in Sources */, - D9263DD71DB946660035CC6E /* NSString+SanitizedForMetricTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Demo/librato-iOS DemoTests/NSString+SanitizedForMetricTests.m b/Demo/librato-iOS DemoTests/NSString+AULSanitizedForMetricTests.m similarity index 95% rename from Demo/librato-iOS DemoTests/NSString+SanitizedForMetricTests.m rename to Demo/librato-iOS DemoTests/NSString+AULSanitizedForMetricTests.m index f7323cd..e60daf0 100644 --- a/Demo/librato-iOS DemoTests/NSString+SanitizedForMetricTests.m +++ b/Demo/librato-iOS DemoTests/NSString+AULSanitizedForMetricTests.m @@ -7,7 +7,7 @@ // #import -#import "NSString+SanitizedForMetric.h" +#import "NSString+AULSanitizedForMetric.h" @interface NSString_SanitizedForMetricTests : XCTestCase @property (nonatomic, strong) NSString *testString; diff --git a/librato-iOS.xcodeproj/project.pbxproj b/librato-iOS.xcodeproj/project.pbxproj index 7396bdc..3f5ca57 100644 --- a/librato-iOS.xcodeproj/project.pbxproj +++ b/librato-iOS.xcodeproj/project.pbxproj @@ -17,7 +17,7 @@ 6692259917FE44B800237E77 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6692258117FE44B800237E77 /* UIKit.framework */; }; 669225A117FE44B800237E77 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6692259F17FE44B800237E77 /* InfoPlist.strings */; }; 669225A317FE44B800237E77 /* librato_iOSTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 669225A217FE44B800237E77 /* librato_iOSTests.m */; }; - 669225B117FE457800237E77 /* NSString+SanitizedForMetric.m in Sources */ = {isa = PBXBuildFile; fileRef = 669225B017FE457800237E77 /* NSString+SanitizedForMetric.m */; }; + 669225B117FE457800237E77 /* NSString+AYLSanitizedForMetric.m in Sources */ = {isa = PBXBuildFile; fileRef = 669225B017FE457800237E77 /* NSString+AYLSanitizedForMetric.m */; }; 669225C017FE458100237E77 /* LibratoClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 669225B317FE458100237E77 /* LibratoClient.m */; }; 669225C117FE458100237E77 /* LibratoConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 669225B517FE458100237E77 /* LibratoConnection.m */; }; 669225C217FE458100237E77 /* LibratoDirectPersister.m in Sources */ = {isa = PBXBuildFile; fileRef = 669225B717FE458100237E77 /* LibratoDirectPersister.m */; }; @@ -57,8 +57,8 @@ 6692259E17FE44B800237E77 /* librato-iOSTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "librato-iOSTests-Info.plist"; sourceTree = ""; }; 669225A017FE44B800237E77 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 669225A217FE44B800237E77 /* librato_iOSTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = librato_iOSTests.m; sourceTree = ""; }; - 669225AF17FE457800237E77 /* NSString+SanitizedForMetric.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+SanitizedForMetric.h"; sourceTree = ""; }; - 669225B017FE457800237E77 /* NSString+SanitizedForMetric.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+SanitizedForMetric.m"; sourceTree = ""; }; + 669225AF17FE457800237E77 /* NSString+AYLSanitizedForMetric.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+AYLSanitizedForMetric.h"; sourceTree = ""; }; + 669225B017FE457800237E77 /* NSString+AYLSanitizedForMetric.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+AYLSanitizedForMetric.m"; sourceTree = ""; }; 669225B217FE458100237E77 /* LibratoClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LibratoClient.h; sourceTree = ""; }; 669225B317FE458100237E77 /* LibratoClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LibratoClient.m; sourceTree = ""; }; 669225B417FE458100237E77 /* LibratoConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LibratoConnection.h; sourceTree = ""; }; @@ -184,8 +184,8 @@ 669225AC17FE454800237E77 /* Categories */ = { isa = PBXGroup; children = ( - 669225AF17FE457800237E77 /* NSString+SanitizedForMetric.h */, - 669225B017FE457800237E77 /* NSString+SanitizedForMetric.m */, + 669225AF17FE457800237E77 /* NSString+AYLSanitizedForMetric.h */, + 669225B017FE457800237E77 /* NSString+AYLSanitizedForMetric.m */, ); path = Categories; sourceTree = ""; @@ -335,7 +335,7 @@ 669225C417FE458100237E77 /* LibratoProcessor.m in Sources */, 669225C517FE458100237E77 /* LibratoQueue.m in Sources */, 6692260A17FF3C2A00237E77 /* Librato.m in Sources */, - 669225B117FE457800237E77 /* NSString+SanitizedForMetric.m in Sources */, + 669225B117FE457800237E77 /* NSString+AYLSanitizedForMetric.m in Sources */, 669225C617FE458100237E77 /* LibratoVersion.m in Sources */, 669225CC17FE458800237E77 /* LibratoMetric.m in Sources */, 669225C017FE458100237E77 /* LibratoClient.m in Sources */, diff --git a/librato-iOS/Categories/NSString+SanitizedForMetric.h b/librato-iOS/Categories/NSString+AYLSanitizedForMetric.h similarity index 62% rename from librato-iOS/Categories/NSString+SanitizedForMetric.h rename to librato-iOS/Categories/NSString+AYLSanitizedForMetric.h index 56d0fc7..71c2023 100644 --- a/librato-iOS/Categories/NSString+SanitizedForMetric.h +++ b/librato-iOS/Categories/NSString+AYLSanitizedForMetric.h @@ -1,5 +1,5 @@ // -// NSString+SanitizedForMetric.h +// NSString+AYLSanitizedForMetric.h // Librato-iOS // // Created by Adam Yanalunas on 10/3/13. @@ -8,8 +8,8 @@ #import -@interface NSString (SanitizedForMetric) +@interface NSString (AYLSanitizedForMetric) -- (NSString *)sanitizedForMetric; +- (NSString *)ayl_sanitizedForMetric; @end diff --git a/librato-iOS/Categories/NSString+SanitizedForMetric.m b/librato-iOS/Categories/NSString+AYLSanitizedForMetric.m similarity index 76% rename from librato-iOS/Categories/NSString+SanitizedForMetric.m rename to librato-iOS/Categories/NSString+AYLSanitizedForMetric.m index 838b31a..3c77958 100644 --- a/librato-iOS/Categories/NSString+SanitizedForMetric.m +++ b/librato-iOS/Categories/NSString+AYLSanitizedForMetric.m @@ -1,16 +1,16 @@ // -// NSString+SanitizedForMetric.m +// NSString+AYLSanitizedForMetric.m // Librato-iOS // // Created by Adam Yanalunas on 10/3/13. // Copyright (c) 2013 Amco International Education Services, LLC. All rights reserved. // -#import "NSString+SanitizedForMetric.h" +#import "NSString+AYLSanitizedForMetric.h" -@implementation NSString (SanitizedForMetric) +@implementation NSString (AYLSanitizedForMetric) -- (NSString *)sanitizedForMetric +- (NSString *)ayl_sanitizedForMetric { NSCharacterSet *allowedSet = [NSCharacterSet characterSetWithCharactersInString:@"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.:-_"]; NSString *cleaned = [[self componentsSeparatedByCharactersInSet:allowedSet.invertedSet] componentsJoinedByString:@"-"]; diff --git a/librato-iOS/Metrics/LibratoMetric.m b/librato-iOS/Metrics/LibratoMetric.m index 50f4697..1fac810 100644 --- a/librato-iOS/Metrics/LibratoMetric.m +++ b/librato-iOS/Metrics/LibratoMetric.m @@ -7,7 +7,7 @@ // #import "LibratoMetric.h" -#import "NSString+SanitizedForMetric.h" +#import "NSString+AYLSanitizedForMetric.h" #import "MTLValueTransformer.h" NSString *const LibratoMetricMeasureTimeKey = @"measure_time"; @@ -81,9 +81,9 @@ + (NSValueTransformer *)nameJSONTransformer { return [MTLValueTransformer reversibleTransformerWithForwardBlock:^id(NSString *name) { NSAssert(name.length > 0, @"Measurements must be named"); - return name.sanitizedForMetric; + return name.ayl_sanitizedForMetric; } reverseBlock:^id(NSString *name) { - return name.sanitizedForMetric; + return name.ayl_sanitizedForMetric; }]; } @@ -91,9 +91,9 @@ + (NSValueTransformer *)nameJSONTransformer + (NSValueTransformer *)sourceJSONTransformer { return [MTLValueTransformer reversibleTransformerWithForwardBlock:^id(NSString *source) { - return source.sanitizedForMetric; + return source.ayl_sanitizedForMetric; } reverseBlock:^id(NSString *source) { - return (source.length ? source.sanitizedForMetric : nil); + return (source.length ? source.ayl_sanitizedForMetric : nil); }]; }