Class: Pod::Command::RepoSvn::Lint
- Inherits:
-
Pod::Command::RepoSvn
- Object
- Pod::Command
- Pod::Command::RepoSvn
- Pod::Command::RepoSvn::Lint
- Defined in:
- lib/pod/command/repo_svn.rb
Overview
todo: lint is blowing up, fix it - dusty
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Lint
constructor
A new instance of Lint.
- #run ⇒ Object
Methods inherited from Pod::Command::RepoSvn
Constructor Details
#initialize(argv) ⇒ Lint
Returns a new instance of Lint.
190 191 192 193 194 |
# File 'lib/pod/command/repo_svn.rb', line 190 def initialize(argv) @name = argv.shift_argument @only_errors = argv.flag?('only-errors') super end |
Class Method Details
.options ⇒ Object
186 187 188 |
# File 'lib/pod/command/repo_svn.rb', line 186 def self. [["--only-errors", "Lint presents only the errors"]].concat(super) end |
Instance Method Details
#run ⇒ Object
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
# File 'lib/pod/command/repo_svn.rb', line 201 def run if @name dirs = File.exists?(@name) ? [ Pathname.new(@name) ] : [ dir ] else dirs = config.repos_dir.children.select {|c| c.directory?} end dirs.each do |dir| SourcesManager.check_version_information(dir) #todo: test me UI.puts "\nLinting spec repo `#{dir.realpath.basename}`\n".yellow validator = Source::HealthReporter.new(dir) validator.pre_check do |name, version| UI.print '.' end report = validator.analyze UI.puts UI.puts report.pods_by_warning.each do |, versions_by_name| UI.puts "-> #{}".yellow versions_by_name.each { |name, versions| UI.puts " - #{name} (#{versions * ', '})" } UI.puts end report.pods_by_error.each do |, versions_by_name| UI.puts "-> #{}".red versions_by_name.each { |name, versions| UI.puts " - #{name} (#{versions * ', '})" } UI.puts end UI.puts "Analyzed #{report.analyzed_paths.count} podspecs files.\n\n" if report.pods_by_error.count.zero? UI.puts "All the specs passed validation.".green << "\n\n" else raise Informative, "#{report.pods_by_error.count} podspecs failed validation." end end end |