Object
RDoc stats collector
# File lib/rdoc/stats.rb, line 17
17: def initialize(total_files, verbosity = 1)
18: @nodoc_constants = 0
19: @nodoc_methods = 0
20:
21: @num_constants = 0
22: @num_files = 0
23: @num_methods = 0
24:
25: @total_files = total_files
26:
27: @start = Time.now
28:
29: @display = case verbosity
30: when 0 then Quiet.new total_files
31: when 1 then Normal.new total_files
32: else Verbose.new total_files
33: end
34: end
# File lib/rdoc/stats.rb, line 40
40: def add_alias(as)
41: @display.print_alias as
42: @num_methods += 1
43: @nodoc_methods += 1 if as.document_self and as.comment.empty?
44: end
# File lib/rdoc/stats.rb, line 46
46: def add_class(klass)
47: @display.print_class klass
48: end
# File lib/rdoc/stats.rb, line 50
50: def add_constant(constant)
51: @display.print_constant constant
52: @num_constants += 1
53: @nodoc_constants += 1 if constant.document_self and constant.comment.empty?
54: end
# File lib/rdoc/stats.rb, line 56
56: def add_file(file)
57: @display.print_file @num_files, file
58: @num_files += 1
59: end
# File lib/rdoc/stats.rb, line 61
61: def add_method(method)
62: @display.print_method method
63: @num_methods += 1
64: @nodoc_methods += 1 if method.document_self and method.comment.empty?
65: end
# File lib/rdoc/stats.rb, line 67
67: def add_module(mod)
68: @display.print_module mod
69: end
# File lib/rdoc/stats.rb, line 36
36: def begin_adding
37: @display.begin_adding
38: end
# File lib/rdoc/stats.rb, line 71
71: def done_adding
72: @display.done_adding
73: end
# File lib/rdoc/stats.rb, line 75
75: def print
76: classes = RDoc::TopLevel.classes
77: num_classes = classes.length
78: nodoc_classes = classes.select do |klass|
79: klass.document_self and klass.comment.empty?
80: end.length
81:
82: modules = RDoc::TopLevel.modules
83: num_modules = modules.length
84: nodoc_modules = modules.select do |mod|
85: mod.document_self and mod.comment.empty?
86: end.length
87:
88: items = num_classes + @num_constants + num_modules + @num_methods
89: doc_items = items -
90: nodoc_classes - @nodoc_constants - nodoc_modules - @nodoc_methods
91:
92: percent_doc = doc_items.to_f / items * 100
93:
94: puts "Files: %5d" % @num_files
95: puts "Classes: %5d (%5d undocumented)" % [num_classes, nodoc_classes]
96: puts "Constants: %5d (%5d undocumented)" %
97: [@num_constants, @nodoc_constants]
98: puts "Modules: %5d (%5d undocumented)" % [num_modules, nodoc_modules]
99: puts "Methods: %5d (%5d undocumented)" % [@num_methods, @nodoc_methods]
100: puts "%6.2f%% documented" % percent_doc
101: puts
102: puts "Elapsed: %0.1fs" % (Time.now - @start)
103: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.