Class: Pod::Installer::PodfileValidator
- Inherits:
-
Object
- Object
- Pod::Installer::PodfileValidator
- Defined in:
- lib/cocoapods/installer/podfile_validator.rb
Overview
Validate the podfile before installing to catch errors and problems
Instance Attribute Summary collapse
-
#errors ⇒ Array<String>
readonly
Any errors that have occured during the validation.
-
#podfile ⇒ Podfile
readonly
The podfile being validated.
Instance Method Summary collapse
-
#initialize(podfile) ⇒ PodfileValidator
constructor
Initialize a new instance.
-
#message ⇒ Object
A message describing any errors in the validation.
-
#valid? ⇒ Boolean
Wether the podfile is valid is not NOTE: Will execute ‘validate` if the podfile has not yet been validated.
-
#validate ⇒ Object
Validate the podfile Errors are added to the errors array.
Constructor Details
#initialize(podfile) ⇒ PodfileValidator
Initialize a new instance
19 20 21 22 23 |
# File 'lib/cocoapods/installer/podfile_validator.rb', line 19 def initialize(podfile) @podfile = podfile @errors = [] @validated = false end |
Instance Attribute Details
#errors ⇒ Array<String> (readonly)
Returns any errors that have occured during the validation.
13 14 15 |
# File 'lib/cocoapods/installer/podfile_validator.rb', line 13 def errors @errors end |
#podfile ⇒ Podfile (readonly)
Returns The podfile being validated.
9 10 11 |
# File 'lib/cocoapods/installer/podfile_validator.rb', line 9 def podfile @podfile end |
Instance Method Details
#message ⇒ Object
A message describing any errors in the validation
47 48 49 |
# File 'lib/cocoapods/installer/podfile_validator.rb', line 47 def errors.join("\n") end |
#valid? ⇒ Boolean
Wether the podfile is valid is not NOTE: Will execute ‘validate` if the podfile has not yet been validated
38 39 40 41 42 |
# File 'lib/cocoapods/installer/podfile_validator.rb', line 38 def valid? validate unless @validated @validated && errors.size == 0 end |
#validate ⇒ Object
Validate the podfile Errors are added to the errors array
28 29 30 31 32 |
# File 'lib/cocoapods/installer/podfile_validator.rb', line 28 def validate validate_pod_directives @validated = true end |