Class: Pod::Command::Spec::Lint
- Inherits:
-
Pod::Command::Spec
- Object
- CLAide::Command
- Pod::Command
- Pod::Command::Spec
- Pod::Command::Spec::Lint
- Defined in:
- lib/cocoapods/command/spec.rb
Overview
———————————————————————–#
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Lint
constructor
A new instance of Lint.
- #run ⇒ Object
Methods inherited from Pod::Command
Methods included from Pod::Config::Mixin
Constructor Details
#initialize(argv) ⇒ Lint
Returns a new instance of Lint.
77 78 79 80 81 82 83 84 |
# File 'lib/cocoapods/command/spec.rb', line 77 def initialize(argv) @quick = argv.flag?('quick') @local = argv.flag?('local') @only_errors = argv.flag?('only-errors') @clean = argv.flag?('clean', true) @podspecs_paths = argv.arguments! super end |
Class Method Details
.options ⇒ Object
70 71 72 73 74 75 |
# File 'lib/cocoapods/command/spec.rb', line 70 def self. [ ["--quick", "Lint skips checks that would require to download and build the spec"], ["--local", "Lint a podspec against the local files contained in its directory"], ["--only-errors", "Lint validates even if warnings are present"], ["--no-clean", "Lint leaves the build directory intact for inspection"] ].concat(super) end |
Instance Method Details
#run ⇒ Object
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/cocoapods/command/spec.rb', line 86 def run UI.puts invalid_count = 0 podspecs_to_lint.each do |podspec| validator = Validator.new(podspec) validator.quick = @quick validator.local = @local validator.no_clean = !@clean validator.only_errors = @only_errors validator.validate invalid_count += 1 unless validator.validated? unless @clean UI.puts "Pods project available at `#{validator.validation_dir}/Pods/Pods.xcodeproj` for inspection." UI.puts end end count = podspecs_to_lint.count UI.puts "Analyzed #{count} #{'podspec'.pluralize(count)}.\n\n" if invalid_count == 0 = count == 1 ? "#{podspecs_to_lint.first.basename} passed validation." : "All the specs passed validation." UI.puts .green << "\n\n" else raise Informative, count == 1 ? "The spec did not pass validation." : "#{invalid_count} out of #{count} specs failed validation." end podspecs_tmp_dir.rmtree if podspecs_tmp_dir.exist? end |