cocoapods-patch 0.0.2 → 0.0.3

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: b39b7df9e697a31cdcee1ce05641aecbce2536510730edbf4ebd309b83d90bef
4
- data.tar.gz: 45a5256704d13fee7002291fd3dec27d7d46005613786d30be017f05fdcf2ea2
3
+ metadata.gz: 0630f65e8646fbca0c6a49834d7cb617ad8fc1895a23bb6eeca1c92cf6ba96fe
4
+ data.tar.gz: 7ddba775f9029c46588750f176870f6b5c5ec27ce0373db22ac5832dab354a85
5
5
  SHA512:
6
- metadata.gz: 3fdb4edae64ad26734cbd980cdb7502a4a3ea4ad956f2c7a4b2ceb604abdf00264b8e7ca5e3ff675ce998b707be504008cfce7e946c9148993255c119fd9ee0c
7
- data.tar.gz: e23fc9606eb1d50a8e1ef0397da6947afd3af47929543f9b1226de9700c6bc1404d84c2eac27b2a2f5294b83b124d7f0663764edb68e55092df5280bc69ed440
6
+ metadata.gz: 6e56809e31e8b3beecdc9bf9df7699915cb8591aa05d70b428ab47803414552d22e14cfce734ec5733002ae9ba5943e97539bbe4853dffea03f539a413a63b4a
7
+ data.tar.gz: 2511dc28bc71ef9f6d04470a315b12f7a442afdb9d1020798ea93ed8ef23faae065c2cedfe8819723e1809b97a114c5598aed7d6d40b8d5aa600cece249f1fc9
@@ -1,3 +1,3 @@
1
1
  module CocoapodsPatch
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -2,13 +2,33 @@ require 'cocoapods'
2
2
  require 'pathname'
3
3
  require_relative 'command/patch/apply'
4
4
 
5
- module CocoapodsPatch
6
- module Hooks
7
- Pod::HooksManager.register('cocoapods-patch', :post_install) do |context|
8
- Pod::UI.puts 'Applying patches if necessary'
9
- patches_dir = Pathname.new(context.sandbox_root) + '..' + 'patches'
10
- patches = patches_dir.each_child.select { |c| c.to_s.end_with?('.diff') }
11
- patches.each { |p| apply_patch(p) }
12
- end
5
+ class Pod::Installer
6
+ # The only way to run my custom method after the pod integrates with the project (http://blog.bigbinary.com/2012/01/08/alias-vs-alias-method.html)
7
+ # Repace the method implementation integrate_user_project with ours
8
+ alias_method :perform_post_install_actions_old, :perform_post_install_actions
9
+
10
+ def perform_post_install_actions
11
+ # integrate with the user project
12
+ perform_post_install_actions_old
13
+ # run custom post_integrate_method
14
+ apply_patches
15
+ end
16
+
17
+ def apply_patches
18
+ Pod::UI.puts 'Applying patches if necessary'
19
+ patches_dir = Pathname.new(Dir.pwd) + 'patches'
20
+ patches = patches_dir.each_child.select { |c| c.to_s.end_with?('.diff') }
21
+ patches.each { |p| apply_patch(p) }
13
22
  end
14
23
  end
24
+
25
+ # module CocoapodsPatch
26
+ # module Hooks
27
+ # Pod::HooksManager.register('cocoapods-patch', :post_integrate) do |context|
28
+ # Pod::UI.puts 'Applying patches if necessary'
29
+ # patches_dir = Pathname.new(context.sandbox_root) + '..' + 'patches'
30
+ # patches = patches_dir.each_child.select { |c| c.to_s.end_with?('.diff') }
31
+ # patches.each { |p| apply_patch(p) }
32
+ # end
33
+ # end
34
+ # 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.2
4
+ version: 0.0.3
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-06-29 00:00:00.000000000 Z
11
+ date: 2020-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler