4 # Simple stats collector
8 attr_reader :num_classes
10 attr_reader :num_methods
11 attr_reader :num_modules
13 def initialize(verbosity = 1)
21 @display = case verbosity
23 when 1 then Normal.new
29 @display.print_alias as
34 @display.print_class klass
39 @display.print_file file
43 def add_method(method)
44 @display.print_method method
49 @display.print_module mod
54 puts "Files: #@num_files"
55 puts "Classes: #@num_classes"
56 puts "Modules: #@num_modules"
57 puts "Methods: #@num_methods"
58 puts "Elapsed: " + sprintf("%0.1fs", Time.now - @start)
62 def print_alias(*) end
63 def print_class(*) end
65 def print_method(*) end
66 def print_module(*) end
74 def print_class(klass)
82 def print_method(method)
93 puts "\t\talias #{as.new_name} #{as.old_name}"
96 def print_class(klass)
97 puts "\tclass #{klass.full_name}"
104 def print_method(method)
105 puts "\t\t#{method.singleton ? '::' : '#'}#{method.name}"
108 def print_module(mod)
109 puts "\tmodule #{mod.full_name}"