Class: PodPrebuild::Diagnosis
- Inherits:
-
Object
- Object
- PodPrebuild::Diagnosis
- Defined in:
- lib/cocoapods-binary-ht/diagnosis/diagnosis.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ Diagnosis
constructor
A new instance of Diagnosis.
- #run ⇒ Object
Constructor Details
#initialize(options) ⇒ Diagnosis
Returns a new instance of Diagnosis.
6 7 8 9 10 |
# File 'lib/cocoapods-binary-ht/diagnosis/diagnosis.rb', line 6 def initialize() @diagnosers = [ IntegrationDiagnosis ].map { |klazz| klazz.new() } end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/cocoapods-binary-ht/diagnosis/diagnosis.rb', line 12 def run diagnosis = @diagnosers.map(&:run) errors = diagnosis.select { |d| d[0] == :error }.map { |d| d[1] } warnings = diagnosis.select { |d| d[0] == :error }.map { |d| d[1] } warnings.each { |d| Pod::UI.puts "⚠️ #{d[1]}" } errors.each { |d| Pod::UI.puts "🚩 #{d[1]}" } return if errors.empty? || !PodPrebuild.config.strict_diagnosis? raise "There are #{errors.count} error(s) spotted after the diagnosis" end |