Class: Pod::Installer

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-time-analyze/install-hook/install_hook.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.alias_step_method(method_sym) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/cocoapods-time-analyze/install-hook/install_hook.rb', line 21

def self.alias_step_method(method_sym)
  if method_defined?(method_sym) || private_method_defined?(method_sym)
    alias_method "origin_#{method_sym}".to_sym, method_sym
  else
    raise "Pod::Installer does not have method named #{method_sym}, please check your .cocoapods_time_analyze_config.rb config file"
  end
end

Instance Method Details

#install!Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/cocoapods-time-analyze/install-hook/install_hook.rb', line 9

def install!
  @time_log = {}

  TimeAnalyzeConfig::PodInstall.target_steps.each { |step| redefine_step_method(step.to_sym) }
  install_start_time = Time.now
  origin_install!
  total_time = (Time.now - install_start_time).round(2)

  TimeAnalyzeConfig::PodInstall.after_all(total_time, @time_log, self)
  write_summary_file(total_time) if TimeAnalyzeConfig::PodInstall.enable_local_summary
end

#origin_install!Object



7
# File 'lib/cocoapods-time-analyze/install-hook/install_hook.rb', line 7

alias origin_install! install!