Class: Pod::Installer

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-patch/hook.rb

Instance Method Summary collapse

Instance Method Details

#apply_patchesObject



19
20
21
22
23
24
25
26
# 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'
  if patches_dir.directory?
    patches = patches_dir.each_child.select { |c| c.to_s.end_with?('.diff') }
    patches.each { |p| apply_patch(p) }
  end
end

#integrateObject



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_oldObject

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