Permalink
Browse files

Skip errors in loaded files. Order warnings and methods alphabetically.

  • Loading branch information...
1 parent a9886e7 commit e076844fc8bb30eabdc83dd324428600b0dc1ac4 @kevinclark committed Mar 16, 2009
Showing with 17 additions and 5 deletions.
  1. +17 −5 bin/dust
View
@@ -36,7 +36,7 @@ class Module
duster.warnings
end.flatten
- $warnings[self][name] = warnings
+ $warnings[self.name][name.to_s] = warnings
end
end
@@ -51,16 +51,28 @@ at_exit do
puts "Nothing to report boss! He's clean!" if $warnings.empty?
- $warnings.each do |klass, methods|
+ class_names_in_order = $warnings.keys.sort
+
+ class_names_in_order.each do |klass|
puts "#{klass}"
- methods.each do |meth, warnings|
+
+ methods_in_order = $warnings[klass].keys.sort
+
+ methods_in_order.each do |meth|
puts " #{meth}"
- warnings.each do |w|
+
+ $warnings[klass][meth].each do |w|
puts " - #{w.message}"
end
end
puts
end
end
-ARGV.each {|file| load file }
+ARGV.each do |file|
+ begin
+ load file
+ rescue Exception => e # grab *everything*
+ $stderr.puts "*** Dust had trouble loading #{file.inspect}:\n\t#{e.class} #{e.message}"
+ end
+end

0 comments on commit e076844

Please sign in to comment.