Skip to content

Commit

Permalink
Skip errors in loaded files. Order warnings and methods alphabetically.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinclark committed Mar 16, 2009
1 parent a9886e7 commit e076844
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions bin/dust
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Module
duster.warnings
end.flatten

$warnings[self][name] = warnings
$warnings[self.name][name.to_s] = warnings
end
end

Expand All @@ -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.