Skip to content

Commit

Permalink
Rename category prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyKuryanov committed Oct 21, 2016
1 parent 06301d1 commit c4c63cf
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Demo/librato-iOS Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<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>"; };
D9263DD61DB946660035CC6E /* NSString+ALMSanitizedForMetricTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+ALMSanitizedForMetricTests.m"; sourceTree = "<group>"; };
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 */

Expand Down Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
//

#import <XCTest/XCTest.h>
#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];
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// NSString+AYLSanitizedForMetric.h
// NSString+ALMSanitizedForMetric.h
// Librato-iOS
//
// Created by Adam Yanalunas on 10/3/13.
Expand All @@ -8,8 +8,8 @@

#import <Foundation/Foundation.h>

@interface NSString (AYLSanitizedForMetric)
@interface NSString (ALMSanitizedForMetric)

- (NSString *)ayl_sanitizedForMetric;
- (NSString *)alm_sanitizedForMetric;

@end
Original file line number Diff line number Diff line change
@@ -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:@"-"];
Expand Down
10 changes: 5 additions & 5 deletions librato-iOS/Metrics/LibratoMetric.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import "LibratoMetric.h"
#import "NSString+AYLSanitizedForMetric.h"
#import "NSString+ALMSanitizedForMetric.h"
#import "MTLValueTransformer.h"

NSString *const LibratoMetricMeasureTimeKey = @"measure_time";
Expand Down Expand Up @@ -81,19 +81,19 @@ + (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;
}];
}


+ (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);
}];
}

Expand Down

0 comments on commit c4c63cf

Please sign in to comment.