Class: Pod::Podfile::TargetDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-cache-proxy/native/podfile_dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ignore_cache_proxyObject (readonly)

Returns the value of attribute ignore_cache_proxy.



19
20
21
# File 'lib/cocoapods-cache-proxy/native/podfile_dsl.rb', line 19

def ignore_cache_proxy
  @ignore_cache_proxy
end

Instance Method Details

#check_ignore_cache_proxy_pod(pod) ⇒ Object



53
54
55
56
57
58
59
60
61
# File 'lib/cocoapods-cache-proxy/native/podfile_dsl.rb', line 53

def check_ignore_cache_proxy_pod(pod)
    return false if pod.blank?
    ignores = []
    ignores.concat(get_ignore_cache_proxy_pods())
    ignores.concat(root.get_ignore_cache_proxy_pods()) if !root?
    ignores.concat(parent.get_ignore_cache_proxy_pods()) unless parent.nil?
    Pod::UI.message "check_ignore_cache_proxy_pod #{name}: #{ignores} #{ignores.uniq.include?(pod)}" if Pod::Config.instance.verbose?
    return ignores.uniq.include?(pod)
end

#get_ignore_cache_proxy_podsObject



45
46
47
48
49
50
51
# File 'lib/cocoapods-cache-proxy/native/podfile_dsl.rb', line 45

def get_ignore_cache_proxy_pods()
    if @ignore_cache_proxy.nil?
        []
    else
        @ignore_cache_proxy.uniq
    end
end

#orig_store_podObject



21
# File 'lib/cocoapods-cache-proxy/native/podfile_dsl.rb', line 21

alias_method :orig_store_pod, :store_pod

#parse_ignore_cache_proxy(name, requirements) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/cocoapods-cache-proxy/native/podfile_dsl.rb', line 28

def parse_ignore_cache_proxy(name, requirements)
    requirements.each do |options|
        next unless options.is_a?(Hash)
        Pod::UI.message "parse_ignore_cache_proxy: #{options}" if Pod::Config.instance.verbose?
        set_ignore_cache_proxy_pods([name]) if options.has_key?(:git)
    end
end

#set_ignore_cache_proxy_pods(pods) ⇒ Object



36
37
38
39
40
41
42
43
# File 'lib/cocoapods-cache-proxy/native/podfile_dsl.rb', line 36

def set_ignore_cache_proxy_pods(pods)
    return if pods.blank?
    @ignore_cache_proxy = [] if @ignore_cache_proxy.nil?
    pods.uniq.each do |pod|
        @ignore_cache_proxy << pod unless @ignore_cache_proxy.include?(pod)
    end
    Pod::UI.message "set_ignore_cache_proxy_pods name: #{@ignore_cache_proxy}" if Pod::Config.instance.verbose?
end

#store_pod(name, *requirements) ⇒ Object



22
23
24
25
26
# File 'lib/cocoapods-cache-proxy/native/podfile_dsl.rb', line 22

def store_pod(name, *requirements)
    Pod::UI.message "store_pod requirements: #{requirements}" if Pod::Config.instance.verbose?
    parse_ignore_cache_proxy(name, requirements)
    orig_store_pod(name, *requirements)
end