cocoapods-patch 0.0.3 → 0.0.4

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: 0630f65e8646fbca0c6a49834d7cb617ad8fc1895a23bb6eeca1c92cf6ba96fe
4
- data.tar.gz: 7ddba775f9029c46588750f176870f6b5c5ec27ce0373db22ac5832dab354a85
3
+ metadata.gz: b9894b0de3c7d124458215a8f93fb28437b98fdaad904eac8019e90a97fa2263
4
+ data.tar.gz: 4f0e69e6cfb98e6de924a1399d6f75720063be8e148796c00bcf61b2fe222222
5
5
  SHA512:
6
- metadata.gz: 6e56809e31e8b3beecdc9bf9df7699915cb8591aa05d70b428ab47803414552d22e14cfce734ec5733002ae9ba5943e97539bbe4853dffea03f539a413a63b4a
7
- data.tar.gz: 2511dc28bc71ef9f6d04470a315b12f7a442afdb9d1020798ea93ed8ef23faae065c2cedfe8819723e1809b97a114c5598aed7d6d40b8d5aa600cece249f1fc9
6
+ metadata.gz: 26fe03a6d87d55716158439f59dc213aede0bf6bf49b76d03d2b8556e9815d889314abc072435c1aa026189bc888f0f8ff4331fb03d6b3549b92f64b03ae905c
7
+ data.tar.gz: e404b677a854b965b1951206ff0dd466de15b3b52fdca78691e89fb83ffed67ea6c5534867d6b1e6fc791bb1bc123aac47f96b691ce72a6b2d0e316ca8d75726
@@ -1,3 +1,3 @@
1
1
  module CocoapodsPatch
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -3,15 +3,17 @@ require 'pathname'
3
3
  require_relative 'command/patch/apply'
4
4
 
5
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
6
+ # Because our patches may also delete files, we need to apply them before the pod project is generated
7
+ # The project is generated in the `integrate` method, so we override it
8
+ # We first run our patch action and then the original implementation of the method
9
+ # Reference: https://github.com/CocoaPods/CocoaPods/blob/760828a07f8fcfbff03bce13f56a1789b6f5a95d/lib/cocoapods/installer.rb#L178
10
+ alias_method :integrate_old, :integrate
9
11
 
10
- def perform_post_install_actions
11
- # integrate with the user project
12
- perform_post_install_actions_old
13
- # run custom post_integrate_method
12
+ def integrate
13
+ # apply our patches
14
14
  apply_patches
15
+ # run the original implementation
16
+ integrate_old
15
17
  end
16
18
 
17
19
  def apply_patches
@@ -21,14 +23,3 @@ class Pod::Installer
21
23
  patches.each { |p| apply_patch(p) }
22
24
  end
23
25
  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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-patch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Double Symmetry