cocoapods-fix-react-native 2018.04.19.12 → 2018.04.26.08

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: 167042f295dfe8b537ca74426acd6a35b2297c6c834143e4babc389eeba16cad
4
- data.tar.gz: bc0eadadddc05ab0bbec5954995c464a57a856a614560cb64eac2e3201405bc3
3
+ metadata.gz: 99cd0dcda7427a76824c404dcf8da5981b51b0b57d998d6a80b21e3f399dc842
4
+ data.tar.gz: 33ccc74e7514c2c5bc1445c6c30f24ed1c018a7d39375853e8eeac3dc554f817
5
5
  SHA512:
6
- metadata.gz: e34fcfcfadf3ec3622a09f00a2e6b5448608b555e7976873f0d3099c110b8b61396209cb56901735cff6a346ee905baa7bd30be9605af230acb01dabdd41cf33
7
- data.tar.gz: 24640054c123cbb7e9cb0de04727f5a404da12b13a08f891e3d3aed36922df6e87bfc2fdfaf25f3f3b55e4ebe443d80414f38111c03a473e2c5c37d46fc93553
6
+ metadata.gz: ea7d34b5774766615b5193f3f51b22195bdf0c1363ef9fcfbc235d287c443582842a799e1f2ed77d69d3e39c610dbee8f42d8f30efd19ff25d4b94249ce2176a
7
+ data.tar.gz: 82281e850cdc94d7f7b79bb0a5a7f4e1074ddfd0ac46f65ca96225b9ce152e93358dd0a4180b2a36a4f787beb78592ca7635ad36e85cf5fe23469835e2b321b6
@@ -16,11 +16,12 @@ class CocoaPodsFixReactNative
16
16
  # binding.pry
17
17
 
18
18
  if File.exist? path_to_fix
19
- puts "Patching React Native #{version}"
20
- require(path_to_fix)
19
+ Pod::UI.section "Patching React Native #{version}" do
20
+ require(path_to_fix)
21
+ end
21
22
  else
22
- puts "CP-Fix-React-Native does not support #{version} yet, please send PRs to"
23
- puts 'https://github.com/orta/cocoapods-fix-react-native'
23
+ Pod::UI.warn "CP-Fix-React-Native does not support #{version} yet, please send " +
24
+ 'PRs to https://github.com/orta/cocoapods-fix-react-native'
24
25
  end
25
26
  end
26
27
  end
@@ -23,11 +23,15 @@ if dev_pods_react
23
23
  end
24
24
 
25
25
  # TODO: move to be both file in pods and file in node_mods?
26
- def edit_pod_file(path, old_code, new_code)
26
+ def patch_pod_file(path, old_code, new_code)
27
27
  file = File.join($root, path)
28
+ unless File.exist?(file)
29
+ Pod::UI.warn "#{file} does not exist so was not patched.."
30
+ return
31
+ end
28
32
  code = File.read(file)
29
33
  if code.include?(old_code)
30
- puts "[CPFRN] Editing #{file}" if Pod::Config.instance.verbose
34
+ Pod::UI.message "Patching #{file}", '- '
31
35
  FileUtils.chmod('+w', file)
32
36
  File.write(file, code.sub(old_code, new_code))
33
37
  end
@@ -46,7 +50,7 @@ def fix_cplusplus_header_compiler_error
46
50
  file.close
47
51
 
48
52
  if contents[32].include? '&'
49
- puts "[CPFRN] Editing #{filepath}" if Pod::Config.instance.verbose
53
+ Pod::UI.message "Patching #{filepath}", '- '
50
54
  contents.insert(26, '#ifdef __cplusplus')
51
55
  contents[36] = '#endif'
52
56
 
@@ -69,7 +73,7 @@ def fix_unused_yoga_headers
69
73
  file.close
70
74
 
71
75
  if contents[12].include? 'Utils.h'
72
- puts "[CPFRN] Editing #{filepath}" if Pod::Config.instance.verbose
76
+ Pod::UI.message "Patching #{filepath}", '- '
73
77
  contents.delete_at(15) # #import "YGNode.h"
74
78
  contents.delete_at(15) # #import "YGNodePrint.h"
75
79
  contents.delete_at(15) # #import "Yoga-internal.h"
@@ -94,7 +98,7 @@ end
94
98
 
95
99
  def detect_missing_subspec_dependency(subspec_name, source_filename, dependent_source_filename)
96
100
  unless meets_pods_project_source_dependency(source_filename, dependent_source_filename)
97
- puts "[!] #{subspec_name} subspec may be required given your current dependencies"
101
+ Pod::UI.warn "#{subspec_name} subspec may be required given your current dependencies"
98
102
  end
99
103
  end
100
104
 
@@ -118,7 +122,7 @@ detect_missing_subspecs
118
122
  animation_view_file = 'Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h'
119
123
  animation_view_old_code = 'import <RCTAnimation/RCTValueAnimatedNode.h>'
120
124
  animation_view_new_code = 'import "RCTValueAnimatedNode.h"'
121
- edit_pod_file animation_view_file, animation_view_old_code, animation_view_new_code
125
+ patch_pod_file animation_view_file, animation_view_old_code, animation_view_new_code
122
126
 
123
127
  # https://github.com/facebook/react-native/issues/13198
124
128
  # Only needed when you have the DevSupport subspec
@@ -129,7 +133,7 @@ if has_dev_support
129
133
  websocket = 'Libraries/WebSocket/RCTReconnectingWebSocket.m'
130
134
  websocket_old_code = 'import <fishhook/fishhook.h>'
131
135
  websocket_new_code = 'import <React/fishhook.h>'
132
- edit_pod_file websocket, websocket_old_code, websocket_new_code
136
+ patch_pod_file websocket, websocket_old_code, websocket_new_code
133
137
  else
134
138
  # There's a link in the DevSettings to dev-only import
135
139
  filepath = "#{$root}/React/Modules/RCTDevSettings.mm"
@@ -145,7 +149,7 @@ else
145
149
  comment_end = '#endif'
146
150
 
147
151
  if contents[22].rstrip != comment_start
148
- puts "[CPFRN] Editing #{filepath}" if Pod::Config.instance.verbose
152
+ Pod::UI.message "Patching #{filepath}", '- '
149
153
 
150
154
  contents.insert(22, comment_start)
151
155
  contents.insert(24, comment_end)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-fix-react-native
3
3
  version: !ruby/object:Gem::Version
4
- version: 2018.04.19.12
4
+ version: 2018.04.26.08
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orta Therox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-19 00:00:00.000000000 Z
11
+ date: 2018-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler