Class: Pod::Source::HealthReporter::HealthReport

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-core/source/health_reporter.rb

Overview

Encapsulates the information about the state of a repo.

Private helpers collapse

Private helpers collapse

Constructor Details

#initialize(source) ⇒ HealthReport

Returns a new instance of HealthReport.

Parameters:


147
148
149
150
151
152
# File 'lib/cocoapods-core/source/health_reporter.rb', line 147

def initialize(source)
  @source = source
  @analyzed_paths = []
  @pods_by_error = {}
  @pods_by_warning = {}
end

Instance Attribute Details

#analyzed_pathsArray<Pathname>

Returns The list of the analyzed paths.

Returns:

  • (Array<Pathname>)

    The list of the analyzed paths.


156
157
158
# File 'lib/cocoapods-core/source/health_reporter.rb', line 156

def analyzed_paths
  @analyzed_paths
end

#pods_by_errorHash{ String => Hash }

Returns The pods (the version grouped by name) grouped by an error message.

Returns:

  • (Hash{ String => Hash })

    The pods (the version grouped by name) grouped by an error message.


161
162
163
# File 'lib/cocoapods-core/source/health_reporter.rb', line 161

def pods_by_error
  @pods_by_error
end

#pods_by_warningHash{ String => Hash }

Returns The pods (the version grouped by name) grouped by a warning message.

Returns:

  • (Hash{ String => Hash })

    The pods (the version grouped by name) grouped by a warning message.


166
167
168
# File 'lib/cocoapods-core/source/health_reporter.rb', line 166

def pods_by_warning
  @pods_by_warning
end

#sourceSource (readonly)

Returns the source analyzed.

Returns:

  • (Source)

    the source analyzed.


143
144
145
# File 'lib/cocoapods-core/source/health_reporter.rb', line 143

def source
  @source
end

Instance Method Details

#add_message(type, message, spec_name, spec_version = nil) ⇒ void

This method returns an undefined value.

Adds a message with the given type for the specification with the given name and version.

Parameters:

  • type (Symbol)

    The type of message. Either :error or :warning.

  • message (String)

    The contents of the message.

  • spec_name (String)

    The name of the Pod.

  • spec_version (String) (defaults to: nil)

    The version of the specification.


185
186
187
188
189
190
191
192
193
194
195
# File 'lib/cocoapods-core/source/health_reporter.rb', line 185

def add_message(type, message, spec_name, spec_version = nil)
  if type == :error
    pods_by_error[message] ||= {}
    pods_by_error[message][spec_name] ||= []
    pods_by_error[message][spec_name] << spec_version
  else
    pods_by_warning[message] ||= {}
    pods_by_warning[message][spec_name] ||= []
    pods_by_warning[message][spec_name] << spec_version
  end
end