mirror of
				https://gitea.invidious.io/iv-org/shard-ameba.git
				synced 2024-08-15 00:53:29 +00:00 
			
		
		
		
	
							parent
							
								
									c9f229c3f1
								
							
						
					
					
						commit
						75ec695a62
					
				
					 1 changed files with 9 additions and 7 deletions
				
			
		| 
						 | 
					@ -13,7 +13,7 @@ module Ameba
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def start(sources)
 | 
					    def start(sources)
 | 
				
			||||||
      puts formatter.before sources
 | 
					      puts formatter.before sources
 | 
				
			||||||
      puts "\n\n"
 | 
					      puts "\n"
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def report(source)
 | 
					    def report(source)
 | 
				
			||||||
| 
						 | 
					@ -36,7 +36,7 @@ module Ameba
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def format(source : Source)
 | 
					    def format(source : Source)
 | 
				
			||||||
      source.errors.size == 0 ? "." : "F"
 | 
					      source.valid? ? ".".colorize(:green) : "F".colorize(:red)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def after(sources)
 | 
					    def after(sources)
 | 
				
			||||||
| 
						 | 
					@ -44,15 +44,17 @@ module Ameba
 | 
				
			||||||
        failures = sources.select { |s| s.errors.any? }
 | 
					        failures = sources.select { |s| s.errors.any? }
 | 
				
			||||||
        l = failures.map { |f| f.errors.size }.sum
 | 
					        l = failures.map { |f| f.errors.size }.sum
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        mes << "#{sources.size} inspected, #{l} failure#{"s" if l != 1}.\n\n"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        failures.each do |failure|
 | 
					        failures.each do |failure|
 | 
				
			||||||
          failure.errors.each do |error|
 | 
					          failure.errors.each do |error|
 | 
				
			||||||
            mes << "#{failure.path}:#{error.pos}"
 | 
					            mes << "#{failure.path}:#{error.pos}\n".colorize(:cyan)
 | 
				
			||||||
            mes << "\n"
 | 
					            mes << "#{error.rule.name}: #{error.message}".colorize(:red)
 | 
				
			||||||
            mes << "#{error.rule.name}: #{error.message}\n\n"
 | 
					            mes << "\n\n"
 | 
				
			||||||
          end
 | 
					          end
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        color = l == 0 ? :green : :red
 | 
				
			||||||
 | 
					        mes << "#{sources.size} inspected, #{l} failure#{"s" if l != 1}."
 | 
				
			||||||
 | 
					          .colorize(color)
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue