rdoc 2.5.11 → 3.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rdoc might be problematic. Click here for more details.
- data.tar.gz.sig +0 -0
- data/.document +1 -0
- data/History.txt +95 -0
- data/Manifest.txt +13 -4
- data/README.txt +9 -3
- data/Rakefile +1 -1
- data/lib/rdoc.rb +15 -298
- data/lib/rdoc/alias.rb +65 -16
- data/lib/rdoc/any_method.rb +27 -150
- data/lib/rdoc/attr.rb +36 -115
- data/lib/rdoc/class_module.rb +236 -22
- data/lib/rdoc/code_object.rb +76 -31
- data/lib/rdoc/constant.rb +32 -4
- data/lib/rdoc/context.rb +494 -222
- data/lib/rdoc/encoding.rb +79 -0
- data/lib/rdoc/erbio.rb +37 -0
- data/lib/rdoc/gauntlet.rb +9 -5
- data/lib/rdoc/generator.rb +33 -1
- data/lib/rdoc/generator/darkfish.rb +284 -375
- data/lib/rdoc/generator/markup.rb +72 -36
- data/lib/rdoc/generator/ri.rb +4 -4
- data/lib/rdoc/generator/template/darkfish/classpage.rhtml +267 -274
- data/lib/rdoc/generator/template/darkfish/filepage.rhtml +91 -91
- data/lib/rdoc/generator/template/darkfish/index.rhtml +45 -45
- data/lib/rdoc/generator/template/darkfish/rdoc.css +298 -298
- data/lib/rdoc/include.rb +40 -1
- data/lib/rdoc/known_classes.rb +1 -0
- data/lib/rdoc/markup.rb +467 -2
- data/lib/rdoc/markup/attribute_manager.rb +24 -6
- data/lib/rdoc/markup/blank_line.rb +11 -3
- data/lib/rdoc/markup/document.rb +6 -0
- data/lib/rdoc/markup/formatter.rb +10 -0
- data/lib/rdoc/markup/formatter_test_case.rb +339 -3
- data/lib/rdoc/markup/heading.rb +3 -0
- data/lib/rdoc/markup/inline.rb +11 -1
- data/lib/rdoc/markup/list.rb +3 -0
- data/lib/rdoc/markup/list_item.rb +3 -0
- data/lib/rdoc/markup/paragraph.rb +3 -0
- data/lib/rdoc/markup/parser.rb +191 -237
- data/lib/rdoc/markup/{preprocess.rb → pre_process.rb} +50 -29
- data/lib/rdoc/markup/raw.rb +4 -0
- data/lib/rdoc/markup/rule.rb +3 -0
- data/lib/rdoc/markup/text_formatter_test_case.rb +116 -0
- data/lib/rdoc/markup/to_ansi.rb +14 -2
- data/lib/rdoc/markup/to_bs.rb +8 -2
- data/lib/rdoc/markup/to_html.rb +84 -91
- data/lib/rdoc/markup/to_html_crossref.rb +77 -26
- data/lib/rdoc/markup/to_rdoc.rb +94 -49
- data/lib/rdoc/markup/to_test.rb +9 -1
- data/lib/rdoc/markup/verbatim.rb +6 -3
- data/lib/rdoc/method_attr.rb +353 -0
- data/lib/rdoc/normal_class.rb +11 -2
- data/lib/rdoc/normal_module.rb +0 -5
- data/lib/rdoc/options.rb +373 -82
- data/lib/rdoc/parser.rb +59 -23
- data/lib/rdoc/parser/c.rb +224 -86
- data/lib/rdoc/parser/ruby.rb +219 -111
- data/lib/rdoc/parser/ruby_tools.rb +4 -1
- data/lib/rdoc/parser/simple.rb +9 -4
- data/lib/rdoc/rdoc.rb +68 -28
- data/lib/rdoc/require.rb +21 -0
- data/lib/rdoc/ri/driver.rb +20 -10
- data/lib/rdoc/ri/paths.rb +2 -2
- data/lib/rdoc/ri/store.rb +22 -5
- data/lib/rdoc/ruby_lex.rb +11 -12
- data/lib/rdoc/ruby_token.rb +2 -2
- data/lib/rdoc/single_class.rb +2 -1
- data/lib/rdoc/stats.rb +202 -162
- data/lib/rdoc/stats/normal.rb +51 -0
- data/lib/rdoc/stats/quiet.rb +59 -0
- data/lib/rdoc/stats/verbose.rb +45 -0
- data/lib/rdoc/text.rb +133 -4
- data/lib/rdoc/{tokenstream.rb → token_stream.rb} +0 -2
- data/lib/rdoc/top_level.rb +230 -39
- data/test/test_attribute_manager.rb +58 -7
- data/test/test_rdoc_alias.rb +13 -0
- data/test/test_rdoc_any_method.rb +43 -2
- data/test/test_rdoc_attr.rb +15 -8
- data/test/test_rdoc_class_module.rb +133 -0
- data/test/test_rdoc_code_object.rb +62 -5
- data/test/test_rdoc_context.rb +72 -26
- data/test/test_rdoc_encoding.rb +145 -0
- data/test/test_rdoc_generator_darkfish.rb +119 -0
- data/test/test_rdoc_generator_ri.rb +22 -2
- data/test/test_rdoc_include.rb +79 -0
- data/test/test_rdoc_markup_attribute_manager.rb +4 -4
- data/test/test_rdoc_markup_parser.rb +134 -95
- data/test/test_rdoc_markup_pre_process.rb +7 -2
- data/test/test_rdoc_markup_to_ansi.rb +43 -153
- data/test/test_rdoc_markup_to_bs.rb +42 -156
- data/test/test_rdoc_markup_to_html.rb +130 -58
- data/test/test_rdoc_markup_to_html_crossref.rb +10 -10
- data/test/test_rdoc_markup_to_rdoc.rb +40 -151
- data/test/test_rdoc_method_attr.rb +122 -0
- data/test/test_rdoc_normal_class.rb +1 -1
- data/test/test_rdoc_normal_module.rb +6 -1
- data/test/test_rdoc_options.rb +237 -12
- data/test/test_rdoc_parser.rb +3 -22
- data/test/test_rdoc_parser_c.rb +203 -2
- data/test/test_rdoc_parser_ruby.rb +403 -89
- data/test/test_rdoc_parser_simple.rb +25 -1
- data/test/test_rdoc_rdoc.rb +44 -32
- data/test/test_rdoc_ri_driver.rb +29 -24
- data/test/test_rdoc_ri_store.rb +46 -3
- data/test/test_rdoc_task.rb +1 -1
- data/test/test_rdoc_text.rb +102 -8
- data/test/test_rdoc_top_level.rb +13 -4
- data/test/xref_data.rb +8 -0
- data/test/xref_test_case.rb +6 -0
- metadata +29 -19
- metadata.gz.sig +0 -0
- data/lib/rdoc/parser/perl.rb +0 -165
- data/test/test_rdoc_parser_perl.rb +0 -73
data/lib/rdoc/ruby_lex.rb
CHANGED
@@ -92,9 +92,9 @@ class RDoc::RubyLex
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def inspect # :nodoc:
|
95
|
-
"#<%s:0x%x lex_state %p space_seen %p>" % [
|
95
|
+
"#<%s:0x%x pos %d lex_state %p space_seen %p>" % [
|
96
96
|
self.class, object_id,
|
97
|
-
@lex_state, @space_seen,
|
97
|
+
@io.pos, @lex_state, @space_seen,
|
98
98
|
]
|
99
99
|
end
|
100
100
|
|
@@ -149,6 +149,7 @@ class RDoc::RubyLex
|
|
149
149
|
else
|
150
150
|
@char_no += 1
|
151
151
|
end
|
152
|
+
|
152
153
|
c
|
153
154
|
end
|
154
155
|
|
@@ -674,7 +675,7 @@ class RDoc::RubyLex
|
|
674
675
|
tk_c = TkLPAREN
|
675
676
|
end
|
676
677
|
@indent_stack.push tk_c
|
677
|
-
|
678
|
+
Token tk_c
|
678
679
|
end
|
679
680
|
|
680
681
|
@OP.def_rule("[]", proc{|op, io| @lex_state == EXPR_FNAME}) do
|
@@ -822,6 +823,12 @@ class RDoc::RubyLex
|
|
822
823
|
end
|
823
824
|
end
|
824
825
|
|
826
|
+
IDENT_RE = if defined? Encoding then
|
827
|
+
/[\w\u0080-\uFFFF]/u
|
828
|
+
else
|
829
|
+
/[\w\x80-\xFF]/
|
830
|
+
end
|
831
|
+
|
825
832
|
def identify_identifier
|
826
833
|
token = ""
|
827
834
|
if peek(0) =~ /[$@]/
|
@@ -831,15 +838,7 @@ class RDoc::RubyLex
|
|
831
838
|
end
|
832
839
|
end
|
833
840
|
|
834
|
-
|
835
|
-
# HACK need a better way to detect oniguruma
|
836
|
-
@identifier_re ||= if defined? Encoding then
|
837
|
-
eval '/[\p{Alnum}_]/u'
|
838
|
-
else
|
839
|
-
eval '/[\w\x80-\xff]/'
|
840
|
-
end
|
841
|
-
|
842
|
-
while (ch = getc) =~ @identifier_re
|
841
|
+
while (ch = getc) =~ IDENT_RE do
|
843
842
|
print " :#{ch}: " if RDoc::RubyLex.debug?
|
844
843
|
token.concat ch
|
845
844
|
end
|
data/lib/rdoc/ruby_token.rb
CHANGED
@@ -178,7 +178,7 @@ module RDoc::RubyToken
|
|
178
178
|
end
|
179
179
|
|
180
180
|
class TkUnknownChar < Token
|
181
|
-
def initialize(seek, line_no, char_no,
|
181
|
+
def initialize(seek, line_no, char_no, name)
|
182
182
|
super(seek, line_no, char_no)
|
183
183
|
@name = name
|
184
184
|
end
|
@@ -253,7 +253,7 @@ module RDoc::RubyToken
|
|
253
253
|
[:TkWHILE, TkKW, "while", EXPR_BEG, :TkWHILE_MOD],
|
254
254
|
[:TkUNTIL, TkKW, "until", EXPR_BEG, :TkUNTIL_MOD],
|
255
255
|
[:TkFOR, TkKW, "for", EXPR_BEG],
|
256
|
-
[:TkBREAK, TkKW, "break",
|
256
|
+
[:TkBREAK, TkKW, "break", EXPR_MID],
|
257
257
|
[:TkNEXT, TkKW, "next", EXPR_END],
|
258
258
|
[:TkREDO, TkKW, "redo", EXPR_END],
|
259
259
|
[:TkRETRY, TkKW, "retry", EXPR_END],
|
data/lib/rdoc/single_class.rb
CHANGED
data/lib/rdoc/stats.rb
CHANGED
@@ -1,247 +1,287 @@
|
|
1
1
|
require 'rdoc'
|
2
2
|
|
3
3
|
##
|
4
|
-
# RDoc
|
4
|
+
# RDoc statistics collector which prints a summary and report of a project's
|
5
|
+
# documentation totals.
|
5
6
|
|
6
7
|
class RDoc::Stats
|
7
8
|
|
8
|
-
|
9
|
-
|
9
|
+
##
|
10
|
+
# Count of files parsed during parsing
|
10
11
|
|
11
|
-
attr_reader :
|
12
|
-
attr_reader :num_files
|
13
|
-
attr_reader :num_methods
|
12
|
+
attr_reader :files_so_far
|
14
13
|
|
15
|
-
|
14
|
+
##
|
15
|
+
# Total number of files found
|
16
16
|
|
17
|
-
|
18
|
-
@nodoc_constants = 0
|
19
|
-
@nodoc_methods = 0
|
17
|
+
attr_reader :num_files
|
20
18
|
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
##
|
20
|
+
# Creates a new Stats that will have +num_files+. +verbosity+ defaults to 1
|
21
|
+
# which will create an RDoc::Stats::Normal outputter.
|
24
22
|
|
25
|
-
|
23
|
+
def initialize num_files, verbosity = 1
|
24
|
+
@files_so_far = 0
|
25
|
+
@num_files = num_files
|
26
|
+
@fully_documented = nil
|
26
27
|
|
27
28
|
@start = Time.now
|
28
29
|
|
29
30
|
@display = case verbosity
|
30
|
-
when 0 then Quiet.new
|
31
|
-
when 1 then Normal.new
|
32
|
-
else Verbose.new
|
31
|
+
when 0 then Quiet.new num_files
|
32
|
+
when 1 then Normal.new num_files
|
33
|
+
else Verbose.new num_files
|
33
34
|
end
|
34
35
|
end
|
35
36
|
|
36
|
-
|
37
|
-
|
38
|
-
end
|
37
|
+
##
|
38
|
+
# Records the parsing of an alias +as+.
|
39
39
|
|
40
|
-
def add_alias
|
40
|
+
def add_alias as
|
41
41
|
@display.print_alias as
|
42
|
-
@num_methods += 1
|
43
|
-
@nodoc_methods += 1 if as.document_self and as.comment.empty?
|
44
42
|
end
|
45
43
|
|
46
|
-
|
44
|
+
##
|
45
|
+
# Records the parsing of an attribute +attribute+
|
46
|
+
|
47
|
+
def add_attribute attribute
|
48
|
+
@display.print_attribute attribute
|
49
|
+
end
|
50
|
+
|
51
|
+
##
|
52
|
+
# Records the parsing of a class +klass+
|
53
|
+
|
54
|
+
def add_class klass
|
47
55
|
@display.print_class klass
|
48
56
|
end
|
49
57
|
|
50
|
-
|
58
|
+
##
|
59
|
+
# Records the parsing of +constant+
|
60
|
+
|
61
|
+
def add_constant constant
|
51
62
|
@display.print_constant constant
|
52
|
-
@num_constants += 1
|
53
|
-
@nodoc_constants += 1 if constant.document_self and constant.comment.empty?
|
54
63
|
end
|
55
64
|
|
65
|
+
##
|
66
|
+
# Records the parsing of +file+
|
67
|
+
|
56
68
|
def add_file(file)
|
57
|
-
@
|
58
|
-
@
|
69
|
+
@files_so_far += 1
|
70
|
+
@display.print_file @files_so_far, file
|
59
71
|
end
|
60
72
|
|
73
|
+
##
|
74
|
+
# Records the parsing of +method+
|
75
|
+
|
61
76
|
def add_method(method)
|
62
77
|
@display.print_method method
|
63
|
-
@num_methods += 1
|
64
|
-
@nodoc_methods += 1 if method.document_self and method.comment.empty?
|
65
78
|
end
|
66
79
|
|
80
|
+
##
|
81
|
+
# Records the parsing of a module +mod+
|
82
|
+
|
67
83
|
def add_module(mod)
|
68
84
|
@display.print_module mod
|
69
85
|
end
|
70
86
|
|
71
|
-
|
72
|
-
|
73
|
-
end
|
87
|
+
##
|
88
|
+
# Call this to mark the beginning of parsing for display purposes
|
74
89
|
|
75
|
-
def
|
76
|
-
|
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)
|
90
|
+
def begin_adding
|
91
|
+
@display.begin_adding
|
103
92
|
end
|
104
93
|
|
105
94
|
##
|
106
|
-
#
|
107
|
-
|
108
|
-
class Quiet
|
95
|
+
# Calculates documentation totals and percentages
|
109
96
|
|
110
|
-
|
111
|
-
|
112
|
-
end
|
113
|
-
|
114
|
-
##
|
115
|
-
# Prints a message at the beginning of parsing
|
97
|
+
def calculate
|
98
|
+
return if @percent_doc
|
116
99
|
|
117
|
-
|
100
|
+
ucm = RDoc::TopLevel.unique_classes_and_modules
|
101
|
+
constants = []
|
102
|
+
ucm.each { |cm| constants.concat cm.constants }
|
118
103
|
|
119
|
-
|
120
|
-
|
104
|
+
methods = []
|
105
|
+
ucm.each { |cm| methods.concat cm.method_list }
|
121
106
|
|
122
|
-
|
107
|
+
attributes = []
|
108
|
+
ucm.each { |cm| attributes.concat cm.attributes }
|
123
109
|
|
124
|
-
|
125
|
-
|
110
|
+
@num_attributes, @undoc_attributes = doc_stats attributes
|
111
|
+
@num_classes, @undoc_classes = doc_stats RDoc::TopLevel.unique_classes
|
112
|
+
@num_constants, @undoc_constants = doc_stats constants
|
113
|
+
@num_methods, @undoc_methods = doc_stats methods
|
114
|
+
@num_modules, @undoc_modules = doc_stats RDoc::TopLevel.unique_modules
|
126
115
|
|
127
|
-
|
116
|
+
@num_items =
|
117
|
+
@num_attributes +
|
118
|
+
@num_classes +
|
119
|
+
@num_constants +
|
120
|
+
@num_methods +
|
121
|
+
@num_modules
|
128
122
|
|
129
|
-
|
130
|
-
|
123
|
+
@undoc_items =
|
124
|
+
@undoc_attributes +
|
125
|
+
@undoc_classes +
|
126
|
+
@undoc_constants +
|
127
|
+
@undoc_methods +
|
128
|
+
@undoc_modules
|
131
129
|
|
132
|
-
|
130
|
+
@doc_items = @num_items - @undoc_items
|
133
131
|
|
134
|
-
|
135
|
-
# Prints when a file is added
|
132
|
+
@fully_documented = (@num_items - @doc_items) == 0
|
136
133
|
|
137
|
-
|
138
|
-
|
139
|
-
##
|
140
|
-
# Prints when a method is added
|
134
|
+
@percent_doc = @doc_items.to_f / @num_items * 100 if @num_items.nonzero?
|
135
|
+
end
|
141
136
|
|
142
|
-
|
137
|
+
##
|
138
|
+
# Returns the length and number of undocumented items in +collection+.
|
143
139
|
|
144
|
-
|
145
|
-
|
140
|
+
def doc_stats collection
|
141
|
+
[collection.length, collection.count { |item| not item.documented? }]
|
142
|
+
end
|
146
143
|
|
147
|
-
|
144
|
+
##
|
145
|
+
# Call this to mark the end of parsing for display purposes
|
148
146
|
|
149
|
-
|
150
|
-
|
147
|
+
def done_adding
|
148
|
+
@display.done_adding
|
149
|
+
end
|
151
150
|
|
152
|
-
|
151
|
+
##
|
152
|
+
# The documentation status of this project. +true+ when 100%, +false+ when
|
153
|
+
# less than 100% and +nil+ when unknown.
|
154
|
+
#
|
155
|
+
# Set by calling #calculate
|
153
156
|
|
157
|
+
def fully_documented?
|
158
|
+
@fully_documented
|
154
159
|
end
|
155
160
|
|
156
161
|
##
|
157
|
-
#
|
158
|
-
# bar
|
162
|
+
# Returns a report on which items are not documented
|
159
163
|
|
160
|
-
|
164
|
+
def report
|
165
|
+
report = []
|
161
166
|
|
162
|
-
|
163
|
-
puts "Parsing sources..."
|
164
|
-
end
|
167
|
+
calculate
|
165
168
|
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
progress_bar = sprintf("%3d%% [%2d/%2d] ",
|
171
|
-
100 * (files_so_far + 1) / @total_files,
|
172
|
-
files_so_far + 1,
|
173
|
-
@total_files)
|
174
|
-
|
175
|
-
if $stdout.tty?
|
176
|
-
# Print a progress bar, but make sure it fits on a single line. Filename
|
177
|
-
# will be truncated if necessary.
|
178
|
-
terminal_width = (ENV['COLUMNS'] || 80).to_i
|
179
|
-
max_filename_size = terminal_width - progress_bar.size
|
180
|
-
if filename.size > max_filename_size
|
181
|
-
# Turn "some_long_filename.rb" to "...ong_filename.rb"
|
182
|
-
filename = filename[(filename.size - max_filename_size) .. -1]
|
183
|
-
filename[0..2] = "..."
|
184
|
-
end
|
169
|
+
if @num_items == @doc_items then
|
170
|
+
report << '100% documentation!'
|
171
|
+
report << nil
|
172
|
+
report << 'Great Job!'
|
185
173
|
|
186
|
-
|
187
|
-
# previous line doesn't show up.
|
188
|
-
line = "#{progress_bar}#{filename}"
|
189
|
-
padding = terminal_width - line.size
|
190
|
-
line << (" " * padding) if padding > 0
|
191
|
-
|
192
|
-
$stdout.print("#{line}\r")
|
193
|
-
else
|
194
|
-
$stdout.puts "#{progress_bar} #{filename}"
|
195
|
-
end
|
196
|
-
$stdout.flush
|
174
|
+
return report.join "\n"
|
197
175
|
end
|
198
176
|
|
199
|
-
|
200
|
-
|
201
|
-
|
177
|
+
report << 'The following items are not documented:'
|
178
|
+
report << nil
|
179
|
+
|
180
|
+
ucm = RDoc::TopLevel.unique_classes_and_modules
|
181
|
+
|
182
|
+
ucm.sort.each do |cm|
|
183
|
+
type = case cm # TODO #definition
|
184
|
+
when RDoc::NormalClass then 'class'
|
185
|
+
when RDoc::SingleClass then 'class <<'
|
186
|
+
when RDoc::NormalModule then 'module'
|
187
|
+
end
|
188
|
+
|
189
|
+
if cm.fully_documented? then
|
190
|
+
next
|
191
|
+
elsif cm.in_files.empty? or
|
192
|
+
(cm.constants.empty? and cm.method_list.empty?) then
|
193
|
+
report << "# #{type} #{cm.full_name} is referenced but empty."
|
194
|
+
report << '#'
|
195
|
+
report << '# It probably came from another project. ' \
|
196
|
+
'I\'m sorry I\'m holding it against you.'
|
197
|
+
report << nil
|
198
|
+
|
199
|
+
next
|
200
|
+
elsif cm.documented? then
|
201
|
+
report << "#{type} #{cm.full_name} # is documented"
|
202
|
+
else
|
203
|
+
report << '# in files:'
|
202
204
|
|
203
|
-
|
205
|
+
cm.in_files.each do |file|
|
206
|
+
report << "# #{file.full_name}"
|
207
|
+
end
|
204
208
|
|
205
|
-
|
206
|
-
# Stats printer that prints everything documented, including the documented
|
207
|
-
# status
|
209
|
+
report << nil
|
208
210
|
|
209
|
-
|
211
|
+
report << "#{type} #{cm.full_name}"
|
212
|
+
end
|
210
213
|
|
211
|
-
|
212
|
-
|
214
|
+
unless cm.constants.empty? then
|
215
|
+
report << nil
|
213
216
|
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
+
cm.each_constant do |constant|
|
218
|
+
next if constant.documented?
|
219
|
+
report << " # in file #{constant.file.full_name}"
|
220
|
+
report << " #{constant.name} = nil"
|
221
|
+
end
|
222
|
+
end
|
217
223
|
|
218
|
-
|
219
|
-
|
220
|
-
end
|
224
|
+
unless cm.attributes.empty? then
|
225
|
+
report << nil
|
221
226
|
|
222
|
-
|
223
|
-
|
224
|
-
|
227
|
+
cm.each_attribute do |attr|
|
228
|
+
next if attr.documented?
|
229
|
+
report << " #{attr.definition} #{attr.name} " \
|
230
|
+
"# in file #{attr.file.full_name}"
|
231
|
+
end
|
232
|
+
end
|
225
233
|
|
226
|
-
|
227
|
-
|
228
|
-
end
|
234
|
+
unless cm.method_list.empty? then
|
235
|
+
report << nil
|
229
236
|
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
237
|
+
cm.each_method do |method|
|
238
|
+
next if method.documented?
|
239
|
+
report << " # in file #{method.file.full_name}"
|
240
|
+
report << " def #{method.name}#{method.params}; end"
|
241
|
+
report << nil
|
242
|
+
end
|
243
|
+
end
|
234
244
|
|
235
|
-
|
236
|
-
|
245
|
+
report << 'end'
|
246
|
+
report << nil
|
237
247
|
end
|
238
248
|
|
239
|
-
|
240
|
-
|
241
|
-
end
|
249
|
+
report.join "\n"
|
250
|
+
end
|
242
251
|
|
252
|
+
##
|
253
|
+
# Returns a summary of the collected statistics.
|
254
|
+
|
255
|
+
def summary
|
256
|
+
calculate
|
257
|
+
|
258
|
+
report = []
|
259
|
+
report << 'Files: %5d' % @num_files
|
260
|
+
report << nil
|
261
|
+
report << 'Classes: %5d (%5d undocumented)' % [@num_classes,
|
262
|
+
@undoc_classes]
|
263
|
+
report << 'Modules: %5d (%5d undocumented)' % [@num_modules,
|
264
|
+
@undoc_modules]
|
265
|
+
report << 'Constants: %5d (%5d undocumented)' % [@num_constants,
|
266
|
+
@undoc_constants]
|
267
|
+
report << 'Attributes: %5d (%5d undocumented)' % [@num_attributes,
|
268
|
+
@undoc_attributes]
|
269
|
+
report << 'Methods: %5d (%5d undocumented)' % [@num_methods,
|
270
|
+
@undoc_methods]
|
271
|
+
report << nil
|
272
|
+
report << 'Total: %5d (%5d undocumented)' % [@num_items,
|
273
|
+
@undoc_items]
|
274
|
+
|
275
|
+
report << '%6.2f%% documented' % @percent_doc if @percent_doc
|
276
|
+
report << nil
|
277
|
+
report << 'Elapsed: %0.1fs' % (Time.now - @start)
|
278
|
+
|
279
|
+
report.join "\n"
|
243
280
|
end
|
244
281
|
|
245
|
-
|
282
|
+
autoload :Quiet, 'rdoc/stats/quiet'
|
283
|
+
autoload :Normal, 'rdoc/stats/normal'
|
284
|
+
autoload :Verbose, 'rdoc/stats/verbose'
|
246
285
|
|
286
|
+
end
|
247
287
|
|