From c4c63cfaf6d6feea7b6b74b889789236702eaca3 Mon Sep 17 00:00:00 2001 From: Sergey Kuryanov Date: Fri, 21 Oct 2016 18:10:08 +0300 Subject: [PATCH] Rename category prefix --- Demo/librato-iOS Demo.xcodeproj/project.pbxproj | 4 ++-- ...icTests.m => NSString+ALMSanitizedForMetricTests.m} | 8 ++++---- ...zedForMetric.h => NSString+ALMSanitizedForMetric.h} | 6 +++--- ...zedForMetric.m => NSString+ALMSanitizedForMetric.m} | 8 ++++---- librato-iOS/Metrics/LibratoMetric.m | 10 +++++----- 5 files changed, 18 insertions(+), 18 deletions(-) rename Demo/librato-iOS DemoTests/{NSString+AULSanitizedForMetricTests.m => NSString+ALMSanitizedForMetricTests.m} (74%) rename librato-iOS/Categories/{NSString+AYLSanitizedForMetric.h => NSString+ALMSanitizedForMetric.h} (62%) rename librato-iOS/Categories/{NSString+AYLSanitizedForMetric.m => NSString+ALMSanitizedForMetric.m} (76%) diff --git a/Demo/librato-iOS Demo.xcodeproj/project.pbxproj b/Demo/librato-iOS Demo.xcodeproj/project.pbxproj index f1b30cc..791a551 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+AULSanitizedForMetricTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+AULSanitizedForMetricTests.m"; sourceTree = ""; }; + D9263DD61DB946660035CC6E /* NSString+ALMSanitizedForMetricTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+ALMSanitizedForMetricTests.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+AULSanitizedForMetricTests.m */, + D9263DD61DB946660035CC6E /* NSString+ALMSanitizedForMetricTests.m */, 6692263D180358B000237E77 /* Supporting Files */, ); path = "librato-iOS DemoTests"; diff --git a/Demo/librato-iOS DemoTests/NSString+AULSanitizedForMetricTests.m b/Demo/librato-iOS DemoTests/NSString+ALMSanitizedForMetricTests.m similarity index 74% rename from Demo/librato-iOS DemoTests/NSString+AULSanitizedForMetricTests.m rename to Demo/librato-iOS DemoTests/NSString+ALMSanitizedForMetricTests.m index e60daf0..4a71f26 100644 --- a/Demo/librato-iOS DemoTests/NSString+AULSanitizedForMetricTests.m +++ b/Demo/librato-iOS DemoTests/NSString+ALMSanitizedForMetricTests.m @@ -7,13 +7,13 @@ // #import -#import "NSString+AULSanitizedForMetric.h" +#import "NSString+ALMSanitizedForMetric.h" -@interface NSString_SanitizedForMetricTests : XCTestCase +@interface NSString_ALMSanitizedForMetricTests : XCTestCase @property (nonatomic, strong) NSString *testString; @end -@implementation NSString_SanitizedForMetricTests +@implementation NSString_ALMSanitizedForMetricTests - (void)setUp { [super setUp]; @@ -30,7 +30,7 @@ - (void)tearDown { - (void)testThatOnlyAllowedCharactersPresent { NSString *expectedString = @"A-Za-z0-9.:-_-------------------_------------------------------------"; - XCTAssertEqualObjects(self.testString.sanitizedForMetric, expectedString); + XCTAssertEqualObjects(self.testString.alm_sanitizedForMetric, expectedString); } @end diff --git a/librato-iOS/Categories/NSString+AYLSanitizedForMetric.h b/librato-iOS/Categories/NSString+ALMSanitizedForMetric.h similarity index 62% rename from librato-iOS/Categories/NSString+AYLSanitizedForMetric.h rename to librato-iOS/Categories/NSString+ALMSanitizedForMetric.h index 71c2023..d4254b3 100644 --- a/librato-iOS/Categories/NSString+AYLSanitizedForMetric.h +++ b/librato-iOS/Categories/NSString+ALMSanitizedForMetric.h @@ -1,5 +1,5 @@ // -// NSString+AYLSanitizedForMetric.h +// NSString+ALMSanitizedForMetric.h // Librato-iOS // // Created by Adam Yanalunas on 10/3/13. @@ -8,8 +8,8 @@ #import -@interface NSString (AYLSanitizedForMetric) +@interface NSString (ALMSanitizedForMetric) -- (NSString *)ayl_sanitizedForMetric; +- (NSString *)alm_sanitizedForMetric; @end diff --git a/librato-iOS/Categories/NSString+AYLSanitizedForMetric.m b/librato-iOS/Categories/NSString+ALMSanitizedForMetric.m similarity index 76% rename from librato-iOS/Categories/NSString+AYLSanitizedForMetric.m rename to librato-iOS/Categories/NSString+ALMSanitizedForMetric.m index 3c77958..b82241f 100644 --- a/librato-iOS/Categories/NSString+AYLSanitizedForMetric.m +++ b/librato-iOS/Categories/NSString+ALMSanitizedForMetric.m @@ -1,16 +1,16 @@ // -// NSString+AYLSanitizedForMetric.m +// NSString+ALMSanitizedForMetric.m // Librato-iOS // // Created by Adam Yanalunas on 10/3/13. // Copyright (c) 2013 Amco International Education Services, LLC. All rights reserved. // -#import "NSString+AYLSanitizedForMetric.h" +#import "NSString+ALMSanitizedForMetric.h" -@implementation NSString (AYLSanitizedForMetric) +@implementation NSString (ALMSanitizedForMetric) -- (NSString *)ayl_sanitizedForMetric +- (NSString *)alm_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 1fac810..667c5cb 100644 --- a/librato-iOS/Metrics/LibratoMetric.m +++ b/librato-iOS/Metrics/LibratoMetric.m @@ -7,7 +7,7 @@ // #import "LibratoMetric.h" -#import "NSString+AYLSanitizedForMetric.h" +#import "NSString+ALMSanitizedForMetric.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.ayl_sanitizedForMetric; + return name.alm_sanitizedForMetric; } reverseBlock:^id(NSString *name) { - return name.ayl_sanitizedForMetric; + return name.alm_sanitizedForMetric; }]; } @@ -91,9 +91,9 @@ + (NSValueTransformer *)nameJSONTransformer + (NSValueTransformer *)sourceJSONTransformer { return [MTLValueTransformer reversibleTransformerWithForwardBlock:^id(NSString *source) { - return source.ayl_sanitizedForMetric; + return source.alm_sanitizedForMetric; } reverseBlock:^id(NSString *source) { - return (source.length ? source.ayl_sanitizedForMetric : nil); + return (source.length ? source.alm_sanitizedForMetric : nil); }]; }