class Pod::Validator
Public Class Methods
method_for_load()
click to toggle source
# File lib/cocoapods-xzlint/PodLibLintPlugin.rb, line 5 def method_for_load puts "load plugin Validator" end
Public Instance Methods
donot_allow_warnings(*args)
click to toggle source
# File lib/cocoapods-xzlint/PodLibLintPlugin.rb, line 74 def donot_allow_warnings(*args) add_result(:notallowwarnings,*args) end
result_type()
click to toggle source
# File lib/cocoapods-xzlint/PodLibLintPlugin.rb, line 23 def result_type applicable_results = results applicable_results = applicable_results.reject(&:public_only?) if ignore_public_only_results types = applicable_results.map(&:type).uniq if types.include?(:error) then :error elsif types.include?(:notallowwarnings) then :notallowwarnings elsif types.include?(:warning) then :warning else :note end end
results_message()
click to toggle source
# File lib/cocoapods-xzlint/PodLibLintPlugin.rb, line 39 def results_message puts "replace origin results_message method" message = '' results.each do |result| if result.platforms == [:ios] platform_message = '[iOS] ' elsif result.platforms == [:osx] platform_message = '[OSX] ' elsif result.platforms == [:watchos] platform_message = '[watchOS] ' elsif result.platforms == [:tvos] platform_message = '[tvOS] ' end subspecs_message = '' if result.is_a?(Result) subspecs = result.subspecs.uniq if subspecs.count > 2 subspecs_message = '[' + subspecs[0..2].join(', ') + ', and more...] ' elsif subspecs.count > 0 subspecs_message = '[' + subspecs.join(',') + '] ' end end case result.type when :error then type = 'ERROR' when :notallowwarnings then type = 'NOTALLOWWARNINGS' when :warning then type = 'WARN' when :note then type = 'NOTE' else raise "#{result.type}" end message << " - #{type.ljust(5)} | #{platform_message}#{subspecs_message}#{result.attribute_name}: #{result.message}\n" end message << "\n" end
validated?()
click to toggle source
# File lib/cocoapods-xzlint/PodLibLintPlugin.rb, line 34 def validated? puts "replace origin valudated method" result_type != :error && result_type != :notallowwarnings && (result_type != :warning || allow_warnings) end