cocoapods-patch 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3903efc0d0530bff3287231e2b52eafb749a871ac703ed58d6834dc1886f9cf8
4
- data.tar.gz: 2bf4ebf6fc98cd8597a0b8f18d0dc038f7ad2defdc99605b634c9b61d18880e1
3
+ metadata.gz: 5f1fc48aa0350d562d1ad476ab439624105cee81c22bab3b604a73131e1dd6eb
4
+ data.tar.gz: b03c8bf4611c20f40536936fa02c2b43f833588b63038d083fe834be9a368a0c
5
5
  SHA512:
6
- metadata.gz: ad177cb33a3b9918d4683c90565be2e7b05c166a363731f80c8b481286dc81284ff101494f595d786680caf880d4eecc5f85295bfb1a24bc4e7f972526958591
7
- data.tar.gz: 1922b47d7e33d01b3974ed455112e3fd78a81064461270868cf5507eb8007b684ff0aaa2bccea3707f755d7db730caf5da7fae0d35ef2d310f11da2476e75d25
6
+ metadata.gz: c96592ef2a7c17cbc4916afc582a0af9219bf2ecf351dbc6f21ab10a6660cb4de8e5a8fcd69c3cada1d5d69c6c29c53e654143f426193e23a0e4bf757acb4d78
7
+ data.tar.gz: c7c7d93705236d902f9ddd02d4102ae800c9280bc1f8549d31b600a7fc4a1c5b6616b2029a0e2468fa58678fabc3dc5d5a9d09ddcba34f83ad414251a7added1
@@ -30,15 +30,25 @@ end
30
30
 
31
31
  # also used from the post-install hook
32
32
  def apply_patch(patch_file)
33
- check_cmd = "git apply --check #{patch_file} --directory=Pods -p2 2> /dev/null"
34
- can_apply = system(check_cmd)
35
- if can_apply
36
- apply_cmd = check_cmd.gsub('--check ', '')
37
- did_apply = system(apply_cmd)
38
- if did_apply
39
- Pod::UI.puts "Successfully applied #{patch_file}"
40
- else
41
- Pod::UI.warn "Failed to apply #{patch_file}"
33
+ working_dir = Dir.pwd
34
+ repo_root = `git rev-parse --show-toplevel`.strip
35
+ ios_project_path = Pathname.new(working_dir).relative_path_from(Pathname.new(repo_root))
36
+
37
+ directory_arg = (ios_project_path.to_s.eql? ".") ? "Pods" : File.join(ios_project_path, 'Pods')
38
+
39
+ Dir.chdir(repo_root) {
40
+ Pod::UI.puts "YOOOOO #{patch_file} - #{directory_arg}"
41
+ check_cmd = "git apply --check #{patch_file} --directory=#{directory_arg} -p2 2> /dev/null"
42
+
43
+ can_apply = system(check_cmd)
44
+ if can_apply
45
+ apply_cmd = check_cmd.gsub('--check ', '')
46
+ did_apply = system(apply_cmd)
47
+ if did_apply
48
+ Pod::UI.puts "Successfully applied #{patch_file}"
49
+ else
50
+ Pod::UI.warn "Failed to apply #{patch_file}"
51
+ end
42
52
  end
43
- end
53
+ }
44
54
  end
@@ -1,3 +1,3 @@
1
1
  module CocoapodsPatch
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-patch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Double Symmetry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-01 00:00:00.000000000 Z
11
+ date: 2021-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler