branch_io_cli 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4599199e006b06d1b616d660c85fa73f04b5c75f687d7bea90511df2cc73b5e0
4
- data.tar.gz: 8b0b81d38d5bec8d6d733c18ff0bfbffa5658ccd6a5d84618403cae1bca5f7d8
3
+ metadata.gz: 875f76682dccf962d868c7ac37b3e5aab590e9655af0fd2266267d56f87e9d2b
4
+ data.tar.gz: 453b47d417a6014d219ee5154c395ed435bf136c647d0d5b31aee0f70096259f
5
5
  SHA512:
6
- metadata.gz: be893c6067fa95597a296c8e7dacc66a847365ab1e5cb124d2000acf64716fd7dc40853839c3abbdc114c6ff0bb7d141e19e13f2694ecfe5b8d5168361f0203a
7
- data.tar.gz: 1549178e5eb7f6e13f4f3e8d4de74171502bec799bb29e1d9ab2da2e4ea45f9c6957edd4818eafe005419d4abec9497f40c51104a7f630bac76043bdd79437a0
6
+ metadata.gz: 1ec7fdaf5b83fd581c5712184082a738d7c07305a9a3ae8bb190ef793e29b99b2952e8ffd031f20d00d30c4b65dc2ad3f87efa6718bdef142bf3ab2775df1c8a
7
+ data.tar.gz: 144f3cff5bdce88845a687d1f1b188fa1872bd229598b2a56f0c96660c34c1274864ee294f3aece2a795f3e9d45f97138d16eb80a19d2ba0bcbcf26d8540d176
@@ -1,4 +1,17 @@
1
+ <% if is_new_method %>
2
+
3
+ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
4
+ <% end %>
5
+ <% if use_conditional_test_key? %>
6
+ #ifdef DEBUG
7
+ [Branch setUseTestBranchKey:YES];
8
+ #endif // DEBUG
9
+ <% end %>
1
10
  [[Branch getInstance] initSessionWithLaunchOptions:launchOptions
2
11
  andRegisterDeepLinkHandlerUsingBranchUniversalObject:^(BranchUniversalObject *universalObject, BranchLinkProperties *linkProperties, NSError *error){
3
12
  // TODO: Route Branch links
4
13
  }];
14
+ <% if is_new_method %>
15
+ return YES;
16
+ }
17
+ <% end %>
@@ -1,5 +1,17 @@
1
+ <% if is_new_method %>
2
+ func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
3
+ <% end %>
4
+ <% if use_conditional_test_key? %>
5
+ #if DEBUG
6
+ Branch.setUseTestBranchKey(true)
7
+ #endif
8
+ <% end %>
1
9
  Branch.getInstance().initSession(launchOptions: launchOptions) {
2
10
  universalObject, linkProperties, error in
3
11
 
4
12
  // TODO: Route Branch links
5
13
  }
14
+ <% if is_new_method %>
15
+ return true
16
+ }
17
+ <% end %>
@@ -21,6 +21,10 @@ module BranchIOCLI
21
21
  helper.add_change change
22
22
  end
23
23
 
24
+ def use_conditional_test_key?
25
+ config.keys.count > 1 && !helper.has_multiple_info_plists?
26
+ end
27
+
24
28
  def patch_bridging_header
25
29
  unless config.bridging_header_path
26
30
  say "Modules not available and bridging header not found. Cannot import Branch."
@@ -95,43 +99,31 @@ module BranchIOCLI
95
99
  def patch_did_finish_launching_method_swift(app_delegate_swift_path)
96
100
  app_delegate_swift = File.read app_delegate_swift_path
97
101
 
98
- patch_name = "did_finish_launching_"
99
- if app_delegate_swift =~ /didFinishLaunching[^\n]+?\{/m
100
- # method already present
101
- patch_name += "test_" unless config.keys.count <= 1 || has_multiple_info_plists?
102
- patch_name += "swift"
103
- patch = load_patch patch_name
104
- patch.regexp = /didFinishLaunchingWithOptions.*?\{[^\n]*\n/m
105
- else
102
+ patch = load_patch(:did_finish_launching_swift)
103
+ is_new_method = app_delegate_swift !~ /didFinishLaunching[^\n]+?\{/m
104
+ if is_new_method
106
105
  # method not present. add entire method
107
- patch_name += "new_"
108
- patch_name += "test_" unless config.keys.count <= 1 || has_multiple_info_plists?
109
- patch_name += "swift"
110
- patch = load_patch patch_name
111
106
  patch.regexp = /var\s+window\s?:\s?UIWindow\?.*?\n/m
107
+ else
108
+ # method already present
109
+ patch.regexp = /didFinishLaunchingWithOptions.*?\{[^\n]*\n/m
112
110
  end
113
- patch.apply app_delegate_swift_path
111
+ patch.apply app_delegate_swift_path, binding: binding
114
112
  end
115
113
 
116
114
  def patch_did_finish_launching_method_objc(app_delegate_objc_path)
117
115
  app_delegate_objc = File.read app_delegate_objc_path
118
116
 
119
- patch_name = "did_finish_launching_"
120
- if app_delegate_objc =~ /didFinishLaunchingWithOptions/m
121
- # method exists. patch it.
122
- patch_name += "test_" unless config.keys.count <= 1 || has_multiple_info_plists?
123
- patch_name += "objc"
124
- patch = load_patch patch_name
125
- patch.regexp = /didFinishLaunchingWithOptions.*?\{[^\n]*\n/m
126
- else
117
+ patch = load_patch(:did_finish_launching_objc)
118
+ is_new_method = app_delegate_objc !~ /didFinishLaunchingWithOptions/m
119
+ if is_new_method
127
120
  # method does not exist. add it.
128
- patch_name += "new_"
129
- patch_name += "test_" unless config.keys.count <= 1 || has_multiple_info_plists?
130
- patch_name += "objc"
131
- patch = load_patch patch_name
132
121
  patch.regexp = /^@implementation.*?\n/m
122
+ else
123
+ # method exists. patch it.
124
+ patch.regexp = /didFinishLaunchingWithOptions.*?\{[^\n]*\n/m
133
125
  end
134
- patch.apply app_delegate_objc_path
126
+ patch.apply app_delegate_objc_path, binding: binding
135
127
  end
136
128
 
137
129
  def patch_open_url_method_swift(app_delegate_swift_path)
@@ -1,3 +1,3 @@
1
1
  module BranchIOCLI
2
- VERSION = "0.9.1"
2
+ VERSION = "0.9.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: branch_io_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Branch
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-11-07 00:00:00.000000000 Z
12
+ date: 2017-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: CFPropertyList
@@ -59,14 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: 0.3.0
62
+ version: 0.4.0
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: 0.3.0
69
+ version: 0.4.0
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: plist
72
72
  requirement: !ruby/object:Gem::Requirement
@@ -256,12 +256,6 @@ files:
256
256
  - lib/assets/patches/ContinueUserActivityNew.swift
257
257
  - lib/assets/patches/DidFinishLaunching.m
258
258
  - lib/assets/patches/DidFinishLaunching.swift
259
- - lib/assets/patches/DidFinishLaunchingNew.m
260
- - lib/assets/patches/DidFinishLaunchingNew.swift
261
- - lib/assets/patches/DidFinishLaunchingNewTest.m
262
- - lib/assets/patches/DidFinishLaunchingNewTest.swift
263
- - lib/assets/patches/DidFinishLaunchingTest.m
264
- - lib/assets/patches/DidFinishLaunchingTest.swift
265
259
  - lib/assets/patches/OpenUrl.m
266
260
  - lib/assets/patches/OpenUrl.swift
267
261
  - lib/assets/patches/OpenUrlNew.m
@@ -273,14 +267,8 @@ files:
273
267
  - lib/assets/patches/continue_user_activity_new_swift.yml
274
268
  - lib/assets/patches/continue_user_activity_objc.yml
275
269
  - lib/assets/patches/continue_user_activity_swift.yml
276
- - lib/assets/patches/did_finish_launching_new_objc.yml
277
- - lib/assets/patches/did_finish_launching_new_swift.yml
278
- - lib/assets/patches/did_finish_launching_new_test_objc.yml
279
- - lib/assets/patches/did_finish_launching_new_test_swift.yml
280
270
  - lib/assets/patches/did_finish_launching_objc.yml
281
271
  - lib/assets/patches/did_finish_launching_swift.yml
282
- - lib/assets/patches/did_finish_launching_test_objc.yml
283
- - lib/assets/patches/did_finish_launching_test_swift.yml
284
272
  - lib/assets/patches/objc_import.yml
285
273
  - lib/assets/patches/open_url_new_objc.yml
286
274
  - lib/assets/patches/open_url_new_swift.yml
@@ -1,9 +0,0 @@
1
-
2
-
3
- - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
4
- [[Branch getInstance] initSessionWithLaunchOptions:launchOptions
5
- andRegisterDeepLinkHandlerUsingBranchUniversalObject:^(BranchUniversalObject *universalObject, BranchLinkProperties *linkProperties, NSError *error){
6
- // TODO: Route Branch links
7
- }];
8
- return YES;
9
- }
@@ -1,9 +0,0 @@
1
-
2
- func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
3
- Branch.getInstance().initSession(launchOptions: launchOptions) {
4
- universalObject, linkProperties, error in
5
-
6
- // TODO: Route Branch links
7
- }
8
- return true
9
- }
@@ -1,13 +0,0 @@
1
-
2
-
3
- - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
4
- #ifdef DEBUG
5
- [Branch setUseTestBranchKey:YES];
6
- #endif // DEBUG
7
-
8
- [[Branch getInstance] initSessionWithLaunchOptions:launchOptions
9
- andRegisterDeepLinkHandlerUsingBranchUniversalObject:^(BranchUniversalObject *universalObject, BranchLinkProperties *linkProperties, NSError *error){
10
- // TODO: Route Branch links
11
- }];
12
- return YES;
13
- }
@@ -1,13 +0,0 @@
1
-
2
- func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
3
- #if DEBUG
4
- Branch.setUseTestBranchKey(true)
5
- #endif
6
-
7
- Branch.getInstance().initSession(launchOptions: launchOptions) {
8
- universalObject, linkProperties, error in
9
-
10
- // TODO: Route Branch links
11
- }
12
- return true
13
- }
@@ -1,8 +0,0 @@
1
- #ifdef DEBUG
2
- [Branch setUseTestBranchKey:YES];
3
- #endif // DEBUG
4
-
5
- [[Branch getInstance] initSessionWithLaunchOptions:launchOptions
6
- andRegisterDeepLinkHandlerUsingBranchUniversalObject:^(BranchUniversalObject *universalObject, BranchLinkProperties *linkProperties, NSError *error){
7
- // TODO: Route Branch links
8
- }];
@@ -1,9 +0,0 @@
1
- #if DEBUG
2
- Branch.setUseTestBranchKey(true)
3
- #endif
4
-
5
- Branch.getInstance().initSession(launchOptions: launchOptions) {
6
- universalObject, linkProperties, error in
7
-
8
- // TODO: Route Branch links
9
- }
@@ -1,2 +0,0 @@
1
- mode: append
2
- text_file: DidFinishLaunchingNew.m
@@ -1,2 +0,0 @@
1
- mode: append
2
- text_file: DidFinishLaunchingNew.swift
@@ -1,2 +0,0 @@
1
- mode: append
2
- text_file: DidFinishLaunchingNewTest.m
@@ -1,2 +0,0 @@
1
- mode: append
2
- text_file: DidFinishLaunchingNewTest.swift
@@ -1,2 +0,0 @@
1
- mode: append
2
- text_file: DidFinishLaunchingTest.m
@@ -1,2 +0,0 @@
1
- mode: append
2
- text_file: DidFinishLaunchingTest.swift