Browse files

Only print unique warnings.

  • Loading branch information...
1 parent 4e96cd7 commit 22dc639ab33da614c1514eea8e4b40b3c658e52e @postmodern committed Jun 24, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/warnings.rb
View
8 lib/warnings.rb
@@ -10,7 +10,13 @@
STDERR.puts "Warnings:"
STDERR.puts
- $WARNINGS.each { |warning| STDERR.puts " #{warning.format}" }
+ unique_warnings = {}
+
+ $WARNINGS.each do |warning|
+ unique_warnings[warning.source_location] ||= warning
+ end
+
+ unqiue_warnings.each { |warning| warning.print }
STDERR.puts
end

0 comments on commit 22dc639

Please sign in to comment.