Class: Pod::Installer
- Inherits:
-
Object
- Object
- Pod::Installer
- Defined in:
- lib/cocoapods-patch/hook.rb
Instance Method Summary collapse
- #apply_patches ⇒ Object
- #integrate ⇒ Object
-
#integrate_old ⇒ Object
Because our patches may also delete files, we need to apply them before the pod project is generated The project is generated in the ‘integrate` method, so we override it We first run our patch action and then the original implementation of the method Reference: github.com/CocoaPods/CocoaPods/blob/760828a07f8fcfbff03bce13f56a1789b6f5a95d/lib/cocoapods/installer.rb#L178.
Instance Method Details
#apply_patches ⇒ Object
19 20 21 22 23 24 |
# File 'lib/cocoapods-patch/hook.rb', line 19 def apply_patches Pod::UI.puts 'Applying patches if necessary' patches_dir = Pathname.new(Dir.pwd) + 'patches' patches = patches_dir.each_child.select { |c| c.to_s.end_with?('.diff') } patches.each { |p| apply_patch(p) } end |
#integrate ⇒ Object
12 13 14 15 16 17 |
# File 'lib/cocoapods-patch/hook.rb', line 12 def integrate # apply our patches apply_patches # run the original implementation integrate_old end |
#integrate_old ⇒ Object
Because our patches may also delete files, we need to apply them before the pod project is generated The project is generated in the ‘integrate` method, so we override it We first run our patch action and then the original implementation of the method Reference: github.com/CocoaPods/CocoaPods/blob/760828a07f8fcfbff03bce13f56a1789b6f5a95d/lib/cocoapods/installer.rb#L178
10 |
# File 'lib/cocoapods-patch/hook.rb', line 10 alias_method :integrate_old, :integrate |