Method: Pod::Podfile::TargetDefinition#inhibit_warnings_hash

Defined in:
lib/cocoapods-core/podfile/target_definition.rb

#inhibit_warnings_hashHash<String, Array> (private)

Returns the inhibit_warnings hash pre-populated with default values.

Returns:

  • (Hash<String, Array>)

    Hash with :all key for inhibiting all warnings, :for_pods key for inhibiting warnings per Pod, and :not_for_pods key for not inhibiting warnings per Pod.



925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 925

def inhibit_warnings_hash
  inhibit_hash = raw_inhibit_warnings_hash
  if exclusive?
    inhibit_hash
  else
    parent_hash = parent.send(:inhibit_warnings_hash).dup
    if parent_hash['not_for_pods']
      # Remove pods that are set to not inhibit inside parent if they are set to inhibit inside current target.
      parent_hash['not_for_pods'] -= Array(inhibit_hash['for_pods'])
    end
    if parent_hash['for_pods']
      # Remove pods that are set to inhibit inside parent if they are set to not inhibit inside current target.
      parent_hash['for_pods'] -= Array(inhibit_hash['for_pods'])
    end
    if inhibit_hash['all']
      # Clean pods that are set to not inhibit inside parent if inhibit_all_warnings! was set.
      parent_hash['not_for_pods'] = nil
      inhibit_hash.delete('all') if parent_hash['all']
    end
    parent_hash.merge(inhibit_hash) do |_, l, r|
      Array(l).concat(r).uniq
    end
  end
end