lib/fasterer/file_traverser.rb in fasterer-0.8.2 vs lib/fasterer/file_traverser.rb in fasterer-0.8.3
- old
+ new
@@ -153,15 +153,17 @@
"#{@files_inspected_count} #{pluralize(@files_inspected_count, 'file')} inspected"
.colorize(:green)
end
def offenses_found_output
+ color = @offenses_found_count.zero? ? :green : :red
"#{@offenses_found_count} #{pluralize(@offenses_found_count, 'offense')} detected"
- .colorize(:red)
+ .colorize(color)
end
def unparsable_files_output
return if @unparsable_files_count.zero?
+
"#{@unparsable_files_count} unparsable #{pluralize(@unparsable_files_count, 'file')} found"
.colorize(:red)
end
def pluralize(n, singular, plural = nil)