Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 9ea68b7

Browse files
committed
feedback
1 parent a067ca6 commit 9ea68b7

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

CodePush.m

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,64 +34,64 @@ @implementation CodePush {
3434

3535
// These keys are used to inspect/augment the metadata
3636
// that is associated with an update's package.
37+
static NSString *const BinaryBundleDateKey = @"binaryDate";
3738
static NSString *const PackageHashKey = @"packageHash";
3839
static NSString *const PackageIsPendingKey = @"isPending";
39-
static NSString *const BinaryBundleDateKey = @"binaryDate";
4040

4141
// These values are used to save the bundleURL and extension for the JS bundle
4242
// in the binary.
43-
static NSString *binaryJsName = @"main";
44-
static NSString *binaryJsExtension = @"jsbundle";
43+
static NSString *bundleResourceName = @"main";
44+
static NSString *bundleResourceExtension = @"jsbundle";
4545

4646

4747
#pragma mark - Public Obj-C API
4848

49-
+ (NSURL *)binaryJsBundleUrl
49+
+ (NSURL *)binaryBundleURL
5050
{
51-
return [[NSBundle mainBundle] URLForResource:binaryJsName withExtension:binaryJsExtension];
51+
return [[NSBundle mainBundle] URLForResource:bundleResourceName withExtension:bundleResourceExtension];
5252
}
5353

5454
+ (NSURL *)bundleURL
5555
{
56-
return [self bundleURLForResource:binaryJsName];
56+
return [self bundleURLForResource:bundleResourceName];
5757
}
5858

5959
+ (NSURL *)bundleURLForResource:(NSString *)resourceName
6060
{
61-
binaryJsName = resourceName;
61+
bundleResourceName = resourceName;
6262
return [self bundleURLForResource:resourceName
63-
withExtension:binaryJsExtension];
63+
withExtension:bundleResourceExtension];
6464
}
6565

6666
+ (NSURL *)bundleURLForResource:(NSString *)resourceName
6767
withExtension:(NSString *)resourceExtension
6868
{
69-
binaryJsName = resourceName;
70-
binaryJsExtension = resourceExtension;
69+
bundleResourceName = resourceName;
70+
bundleResourceExtension = resourceExtension;
7171
NSError *error;
7272
NSString *packageFile = [CodePushPackage getCurrentPackageBundlePath:&error];
73-
NSURL *binaryJsBundleUrl = [self binaryJsBundleUrl];
73+
NSURL *binaryBundleURL = [self binaryBundleURL];
7474

7575
NSString *logMessageFormat = @"Loading JS bundle from %@";
7676

7777
if (error || !packageFile) {
78-
NSLog(logMessageFormat, binaryJsBundleUrl);
78+
NSLog(logMessageFormat, binaryBundleURL);
7979
isRunningBinaryVersion = YES;
80-
return binaryJsBundleUrl;
80+
return binaryBundleURL;
8181
}
8282

8383
NSString *binaryAppVersion = [[CodePushConfig current] appVersion];
8484
NSDictionary *currentPackageMetadata = [CodePushPackage getCurrentPackage:&error];
8585
if (error || !currentPackageMetadata) {
86-
NSLog(logMessageFormat, binaryJsBundleUrl);
86+
NSLog(logMessageFormat, binaryBundleURL);
8787
isRunningBinaryVersion = YES;
88-
return binaryJsBundleUrl;
88+
return binaryBundleURL;
8989
}
9090

9191
NSString *packageDate = [currentPackageMetadata objectForKey:BinaryBundleDateKey];
9292
NSString *packageAppVersion = [currentPackageMetadata objectForKey:@"appVersion"];
9393

94-
if ([[self modifiedDateStringFromFileUrl:binaryJsBundleUrl] isEqualToString:packageDate] && ([CodePush isUsingTestConfiguration] ||[binaryAppVersion isEqualToString:packageAppVersion])) {
94+
if ([[self modifiedDateStringFromFileUrl:binaryBundleURL] isEqualToString:packageDate] && ([CodePush isUsingTestConfiguration] ||[binaryAppVersion isEqualToString:packageAppVersion])) {
9595
// Return package file because it is newer than the app store binary's JS bundle
9696
NSURL *packageUrl = [[NSURL alloc] initFileURLWithPath:packageFile];
9797
NSLog(logMessageFormat, packageUrl);
@@ -102,9 +102,9 @@ + (NSURL *)bundleURLForResource:(NSString *)resourceName
102102
[CodePush clearUpdates];
103103
#endif
104104

105-
NSLog(logMessageFormat, binaryJsBundleUrl);
105+
NSLog(logMessageFormat, binaryBundleURL);
106106
isRunningBinaryVersion = YES;
107-
return binaryJsBundleUrl;
107+
return binaryBundleURL;
108108
}
109109
}
110110

@@ -394,9 +394,9 @@ - (void)savePendingUpdate:(NSString *)packageHash
394394
{
395395
dispatch_async(dispatch_get_main_queue(), ^{
396396
NSDictionary *mutableUpdatePackage = [updatePackage mutableCopy];
397-
NSURL *binaryJsBundleUrl = [CodePush binaryJsBundleUrl];
398-
if (binaryJsBundleUrl != nil) {
399-
[mutableUpdatePackage setValue:[CodePush modifiedDateStringFromFileUrl:binaryJsBundleUrl]
397+
NSURL *binaryBundleURL = [CodePush binaryBundleURL];
398+
if (binaryBundleURL != nil) {
399+
[mutableUpdatePackage setValue:[CodePush modifiedDateStringFromFileUrl:binaryBundleURL]
400400
forKey:BinaryBundleDateKey];
401401
}
402402

0 commit comments

Comments
 (0)