Class: Pod::Podfile::TargetDefinition
- Inherits:
-
Object
- Object
- Pod::Podfile::TargetDefinition
- Defined in:
- lib/cocoapods-cache-proxy/native/podfile_dsl.rb
Instance Attribute Summary collapse
-
#cache_proxy_source ⇒ Object
readonly
Returns the value of attribute cache_proxy_source.
-
#ignore_cache_proxy ⇒ Object
readonly
Returns the value of attribute ignore_cache_proxy.
Instance Method Summary collapse
- #check_ignore_cache_proxy_pod(pod) ⇒ TrueClass, FalseClass
- #get_ignore_cache_proxy_pods ⇒ Array<String>
-
#orig_parse_inhibit_warnings ⇒ Object
—- patch method —- We want modify ‘store_pod` method, but it’s hard to insert a line in the implementation.
- #parse_inhibit_warnings(name, requirements) ⇒ Object
- #proxy_source_for_pod(pod) ⇒ CacheProxySource
- #set_ignore_cache_proxy_pods(pods) ⇒ Object
Instance Attribute Details
#cache_proxy_source ⇒ Object (readonly)
Returns the value of attribute cache_proxy_source.
32 33 34 |
# File 'lib/cocoapods-cache-proxy/native/podfile_dsl.rb', line 32 def cache_proxy_source @cache_proxy_source end |
#ignore_cache_proxy ⇒ Object (readonly)
Returns the value of attribute ignore_cache_proxy.
31 32 33 |
# File 'lib/cocoapods-cache-proxy/native/podfile_dsl.rb', line 31 def ignore_cache_proxy @ignore_cache_proxy end |
Instance Method Details
#check_ignore_cache_proxy_pod(pod) ⇒ TrueClass, FalseClass
119 120 121 122 123 124 125 126 |
# File 'lib/cocoapods-cache-proxy/native/podfile_dsl.rb', line 119 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) unless root.nil? ignores.concat(parent.get_ignore_cache_proxy_pods) unless parent.nil? ignores.uniq.include?(pod) end |
#get_ignore_cache_proxy_pods ⇒ Array<String>
113 114 115 |
# File 'lib/cocoapods-cache-proxy/native/podfile_dsl.rb', line 113 def get_ignore_cache_proxy_pods @ignore_cache_proxy.nil? ? [] : @ignore_cache_proxy.uniq end |
#orig_parse_inhibit_warnings ⇒ Object
—- patch method —- We want modify ‘store_pod` method, but it’s hard to insert a line in the implementation. So we patch a method called in ‘store_pod`.
51 |
# File 'lib/cocoapods-cache-proxy/native/podfile_dsl.rb', line 51 alias_method :orig_parse_inhibit_warnings, :parse_inhibit_warnings |
#parse_inhibit_warnings(name, requirements) ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/cocoapods-cache-proxy/native/podfile_dsl.rb', line 52 def parse_inhibit_warnings(name, requirements) = requirements.last if .is_a?(Hash) if .has_key?(Pod::Podfile::IgnorePodProxy.keyword) ignore = [Pod::Podfile::IgnorePodProxy.keyword] .delete(Pod::Podfile::IgnorePodProxy.keyword) set_ignore_cache_proxy_pods([name]) if ignore end if .has_key?(Pod::Podfile::UsedPodProxySource.keyword) source_name = [Pod::Podfile::UsedPodProxySource.keyword] .delete(Pod::Podfile::UsedPodProxySource.keyword) unless source_name.blank? raise Pod::Informative.exception "cache proxy source: `#{source_name}` source does not exist." unless (source = CPSH.get_cache_proxy_source_conf(source_name)) @cache_proxy_source = Hash.new if @cache_proxy_source.nil? @cache_proxy_source[name] = source end end requirements.pop if .empty? end orig_parse_inhibit_warnings(name, requirements) end |
#proxy_source_for_pod(pod) ⇒ CacheProxySource
130 131 132 133 |
# File 'lib/cocoapods-cache-proxy/native/podfile_dsl.rb', line 130 def proxy_source_for_pod(pod) return nil if @cache_proxy_source.blank? @cache_proxy_source[pod] end |
#set_ignore_cache_proxy_pods(pods) ⇒ Object
104 105 106 107 108 109 110 |
# File 'lib/cocoapods-cache-proxy/native/podfile_dsl.rb', line 104 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 end |