rdoc 2.4.3 → 2.5

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.

Files changed (139) hide show
  1. data.tar.gz.sig +0 -0
  2. data/.autotest +3 -1
  3. data/History.txt +68 -0
  4. data/LICENSE.txt +57 -0
  5. data/Manifest.txt +37 -19
  6. data/README.txt +2 -12
  7. data/Rakefile +12 -12
  8. data/bin/rdoc +4 -4
  9. data/lib/rdoc.rb +32 -9
  10. data/lib/rdoc/alias.rb +2 -2
  11. data/lib/rdoc/any_method.rb +108 -16
  12. data/lib/rdoc/attr.rb +87 -1
  13. data/lib/rdoc/class_module.rb +131 -5
  14. data/lib/rdoc/code_object.rb +28 -5
  15. data/lib/rdoc/constant.rb +22 -0
  16. data/lib/rdoc/context.rb +80 -37
  17. data/lib/rdoc/gauntlet.rb +48 -0
  18. data/lib/rdoc/generator/darkfish.rb +25 -23
  19. data/lib/rdoc/generator/markup.rb +6 -29
  20. data/lib/rdoc/generator/ri.rb +39 -189
  21. data/lib/rdoc/generator/template/darkfish/classpage.rhtml +17 -1
  22. data/lib/rdoc/generator/template/darkfish/filepage.rhtml +10 -0
  23. data/lib/rdoc/generator/template/darkfish/images/brick.png +0 -0
  24. data/lib/rdoc/generator/template/darkfish/images/brick_link.png +0 -0
  25. data/lib/rdoc/generator/template/darkfish/images/bullet_black.png +0 -0
  26. data/lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png +0 -0
  27. data/lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png +0 -0
  28. data/lib/rdoc/generator/template/darkfish/images/date.png +0 -0
  29. data/lib/rdoc/generator/template/darkfish/images/find.png +0 -0
  30. data/lib/rdoc/generator/template/darkfish/images/package.png +0 -0
  31. data/lib/rdoc/generator/template/darkfish/images/page_green.png +0 -0
  32. data/lib/rdoc/generator/template/darkfish/images/page_white_text.png +0 -0
  33. data/lib/rdoc/generator/template/darkfish/images/page_white_width.png +0 -0
  34. data/lib/rdoc/generator/template/darkfish/images/plugin.png +0 -0
  35. data/lib/rdoc/generator/template/darkfish/images/ruby.png +0 -0
  36. data/lib/rdoc/generator/template/darkfish/images/tag_green.png +0 -0
  37. data/lib/rdoc/generator/template/darkfish/images/wrench.png +0 -0
  38. data/lib/rdoc/generator/template/darkfish/images/wrench_orange.png +0 -0
  39. data/lib/rdoc/generator/template/darkfish/images/zoom.png +0 -0
  40. data/lib/rdoc/generator/template/darkfish/index.rhtml +2 -2
  41. data/lib/rdoc/generator/template/darkfish/rdoc.css +38 -33
  42. data/lib/rdoc/include.rb +22 -0
  43. data/lib/rdoc/markup.rb +10 -262
  44. data/lib/rdoc/markup/attribute_manager.rb +57 -50
  45. data/lib/rdoc/markup/blank_line.rb +19 -0
  46. data/lib/rdoc/markup/document.rb +72 -0
  47. data/lib/rdoc/markup/formatter.rb +118 -0
  48. data/lib/rdoc/markup/formatter_test_case.rb +341 -0
  49. data/lib/rdoc/markup/heading.rb +17 -0
  50. data/lib/rdoc/markup/inline.rb +6 -5
  51. data/lib/rdoc/markup/list.rb +78 -0
  52. data/lib/rdoc/markup/list_item.rb +83 -0
  53. data/lib/rdoc/markup/paragraph.rb +66 -0
  54. data/lib/rdoc/markup/parser.rb +528 -0
  55. data/lib/rdoc/markup/rule.rb +17 -0
  56. data/lib/rdoc/markup/to_ansi.rb +72 -0
  57. data/lib/rdoc/markup/to_bs.rb +74 -0
  58. data/lib/rdoc/markup/to_html.rb +106 -172
  59. data/lib/rdoc/markup/to_html_crossref.rb +10 -4
  60. data/lib/rdoc/markup/to_rdoc.rb +243 -0
  61. data/lib/rdoc/markup/to_test.rb +27 -16
  62. data/lib/rdoc/markup/verbatim.rb +42 -0
  63. data/lib/rdoc/normal_class.rb +38 -1
  64. data/lib/rdoc/normal_module.rb +38 -8
  65. data/lib/rdoc/options.rb +39 -151
  66. data/lib/rdoc/parser.rb +36 -18
  67. data/lib/rdoc/parser/c.rb +102 -109
  68. data/lib/rdoc/parser/ruby.rb +359 -1662
  69. data/lib/rdoc/parser/ruby_tools.rb +157 -0
  70. data/lib/rdoc/parser/simple.rb +0 -2
  71. data/lib/rdoc/rdoc.rb +142 -82
  72. data/lib/rdoc/ri.rb +10 -0
  73. data/lib/rdoc/ri/driver.rb +674 -444
  74. data/lib/rdoc/ri/formatter.rb +2 -651
  75. data/lib/rdoc/ri/paths.rb +70 -45
  76. data/lib/rdoc/ri/store.rb +248 -0
  77. data/lib/rdoc/ruby_lex.rb +1284 -0
  78. data/lib/rdoc/ruby_token.rb +416 -0
  79. data/lib/rdoc/single_class.rb +5 -0
  80. data/lib/rdoc/stats.rb +152 -83
  81. data/lib/rdoc/task.rb +27 -49
  82. data/lib/rdoc/text.rb +130 -0
  83. data/lib/rdoc/tokenstream.rb +28 -9
  84. data/lib/rdoc/top_level.rb +49 -43
  85. data/test/hidden.zip.txt +1 -0
  86. data/test/test_attribute_manager.rb +9 -16
  87. data/test/test_rdoc_any_method.rb +23 -0
  88. data/test/test_rdoc_attr.rb +40 -0
  89. data/test/test_rdoc_class_module.rb +100 -0
  90. data/test/test_rdoc_code_object.rb +18 -2
  91. data/test/test_rdoc_context.rb +41 -0
  92. data/test/test_rdoc_generator_ri.rb +56 -0
  93. data/test/test_rdoc_markup.rb +21 -610
  94. data/test/test_rdoc_markup_attribute_manager.rb +14 -17
  95. data/test/test_rdoc_markup_document.rb +51 -0
  96. data/test/test_rdoc_markup_paragraph.rb +27 -0
  97. data/test/test_rdoc_markup_parser.rb +1327 -0
  98. data/test/test_rdoc_markup_to_ansi.rb +426 -0
  99. data/test/test_rdoc_markup_to_bs.rb +443 -0
  100. data/test/test_rdoc_markup_to_html.rb +183 -18
  101. data/test/test_rdoc_markup_to_html_crossref.rb +1 -3
  102. data/test/test_rdoc_markup_to_rdoc.rb +426 -0
  103. data/test/test_rdoc_normal_class.rb +17 -0
  104. data/test/test_rdoc_normal_module.rb +6 -6
  105. data/test/test_rdoc_options.rb +41 -0
  106. data/test/test_rdoc_parser.rb +66 -13
  107. data/test/test_rdoc_parser_c.rb +93 -38
  108. data/test/test_rdoc_parser_perl.rb +2 -3
  109. data/test/test_rdoc_parser_ruby.rb +291 -28
  110. data/test/test_rdoc_parser_simple.rb +48 -0
  111. data/test/test_rdoc_rdoc.rb +66 -0
  112. data/test/test_rdoc_ri_driver.rb +752 -38
  113. data/test/test_rdoc_ri_paths.rb +39 -0
  114. data/test/test_rdoc_ri_store.rb +309 -0
  115. data/test/test_rdoc_text.rb +157 -0
  116. data/test/test_rdoc_top_level.rb +35 -9
  117. data/test/xref_data.rb +9 -1
  118. data/test/xref_test_case.rb +8 -3
  119. metadata +110 -38
  120. metadata.gz.sig +0 -0
  121. data/lib/rdoc/cache.rb +0 -41
  122. data/lib/rdoc/diagram.rb +0 -340
  123. data/lib/rdoc/dot.rb +0 -249
  124. data/lib/rdoc/markup/fragments.rb +0 -377
  125. data/lib/rdoc/markup/lines.rb +0 -156
  126. data/lib/rdoc/markup/to_flow.rb +0 -211
  127. data/lib/rdoc/markup/to_latex.rb +0 -328
  128. data/lib/rdoc/markup/to_texinfo.rb +0 -73
  129. data/lib/rdoc/ri/cache.rb +0 -187
  130. data/lib/rdoc/ri/descriptions.rb +0 -156
  131. data/lib/rdoc/ri/display.rb +0 -340
  132. data/lib/rdoc/ri/reader.rb +0 -106
  133. data/lib/rdoc/ri/util.rb +0 -79
  134. data/lib/rdoc/ri/writer.rb +0 -68
  135. data/test/test_rdoc_ri_attribute_formatter.rb +0 -44
  136. data/test/test_rdoc_ri_default_display.rb +0 -302
  137. data/test/test_rdoc_ri_formatter.rb +0 -320
  138. data/test/test_rdoc_ri_html_formatter.rb +0 -141
  139. data/test/test_rdoc_ri_overstrike_formatter.rb +0 -71
@@ -1,3 +1,4 @@
1
+ #--
1
2
  # Copyright (c) 2003, 2004 Jim Weirich, 2009 Eric Hodel
2
3
  #
3
4
  # Permission is hereby granted, free of charge, to any person obtaining
@@ -18,6 +19,7 @@
18
19
  # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
20
  # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
21
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ #++
21
23
 
22
24
  require 'rubygems'
23
25
  begin
@@ -39,14 +41,14 @@ require 'rake/tasklib'
39
41
  #
40
42
  # The RDoc::Task will create the following targets:
41
43
  #
42
- # [<b><em>rdoc</em></b>]
44
+ # [rdoc]
43
45
  # Main task for this RDoc task.
44
46
  #
45
- # [<b>:clobber_<em>rdoc</em></b>]
47
+ # [clobber_rdoc]
46
48
  # Delete all the rdoc files. This target is automatically added to the main
47
49
  # clobber target.
48
50
  #
49
- # [<b>:re<em>rdoc</em></b>]
51
+ # [rerdoc]
50
52
  # Rebuild the rdoc files from scratch, even if they are not out of date.
51
53
  #
52
54
  # Simple Example:
@@ -83,7 +85,7 @@ require 'rake/tasklib'
83
85
  # RDoc::Task.new(:rdoc => "rdoc", :clobber_rdoc => "rdoc:clean",
84
86
  # :rerdoc => "rdoc:force")
85
87
  #
86
- # This will create the tasks <tt>:rdoc</tt>, <tt>:rdoc_clean</tt> and
88
+ # This will create the tasks <tt>:rdoc</tt>, <tt>:rdoc:clean</tt> and
87
89
  # <tt>:rdoc:force</tt>.
88
90
 
89
91
  class RDoc::Task < Rake::TaskLib
@@ -149,7 +151,6 @@ class RDoc::Task < Rake::TaskLib
149
151
  @main = nil
150
152
  @title = nil
151
153
  @template = nil
152
- @external = false
153
154
  @options = []
154
155
  yield self if block_given?
155
156
  define
@@ -159,17 +160,13 @@ class RDoc::Task < Rake::TaskLib
159
160
  # Create the tasks defined by this task lib.
160
161
 
161
162
  def define
162
- if rdoc_task_name != "rdoc" then
163
- desc "Build the RDoc HTML Files"
164
- else
165
- desc "Build the #{rdoc_task_name} HTML Files"
166
- end
163
+ desc "Build the RDoc HTML files"
167
164
  task rdoc_task_name
168
165
 
169
- desc "Force a rebuild of the RDoc files"
166
+ desc "Force rebuild RDoc HTML files"
170
167
  task rerdoc_task_name => [clobber_task_name, rdoc_task_name]
171
168
 
172
- desc "Remove RDoc products"
169
+ desc "Remove RDoc HTML files"
173
170
  task clobber_task_name do
174
171
  rm_r rdoc_dir rescue nil
175
172
  end
@@ -177,48 +174,35 @@ class RDoc::Task < Rake::TaskLib
177
174
  task :clobber => [clobber_task_name]
178
175
 
179
176
  directory @rdoc_dir
177
+
180
178
  task rdoc_task_name => [rdoc_target]
181
179
  file rdoc_target => @rdoc_files + [Rake.application.rakefile] do
182
180
  rm_r @rdoc_dir rescue nil
183
181
  @before_running_rdoc.call if @before_running_rdoc
184
182
  args = option_list + @rdoc_files
185
183
 
186
- if @external then
187
- argstring = args.join(' ')
188
- sh %{ruby -Ivendor vendor/rd #{argstring}}
189
- else
190
- if Rake.application.options.trace then
191
- $stderr.puts "rdoc #{args.join ' '}"
192
- end
193
- require 'rdoc/rdoc'
194
- RDoc::RDoc.new.document(args)
184
+ if Rake.application.options.trace then
185
+ $stderr.puts "rdoc #{args.join ' '}"
195
186
  end
187
+ require 'rdoc/rdoc'
188
+ RDoc::RDoc.new.document(args)
196
189
  end
197
190
 
198
191
  self
199
192
  end
200
193
 
194
+ ##
195
+ # List of options that will be supplied to RDoc
196
+
201
197
  def option_list
202
198
  result = @options.dup
203
- result << "-o" << @rdoc_dir
204
- result << "--main" << quote(main) if main
205
- result << "--title" << quote(title) if title
206
- result << "-T" << quote(template) if template
199
+ result << "-o" << @rdoc_dir
200
+ result << "--main" << main if main
201
+ result << "--title" << title if title
202
+ result << "-T" << template if template
207
203
  result
208
204
  end
209
205
 
210
- def quote(str)
211
- if @external
212
- "'#{str}'"
213
- else
214
- str
215
- end
216
- end
217
-
218
- def option_string
219
- option_list.join(' ')
220
- end
221
-
222
206
  ##
223
207
  # The block passed to this method will be called just before running the
224
208
  # RDoc generator. It is allowed to modify RDoc::Task attributes inside the
@@ -236,28 +220,22 @@ class RDoc::Task < Rake::TaskLib
236
220
 
237
221
  def rdoc_task_name
238
222
  case name
239
- when Hash
240
- (name[:rdoc] || "rdoc").to_s
241
- else
242
- name.to_s
223
+ when Hash then (name[:rdoc] || "rdoc").to_s
224
+ else name.to_s
243
225
  end
244
226
  end
245
227
 
246
228
  def clobber_task_name
247
229
  case name
248
- when Hash
249
- (name[:clobber_rdoc] || "clobber_rdoc").to_s
250
- else
251
- "clobber_#{name}"
230
+ when Hash then (name[:clobber_rdoc] || "clobber_rdoc").to_s
231
+ else "clobber_#{name}"
252
232
  end
253
233
  end
254
234
 
255
235
  def rerdoc_task_name
256
236
  case name
257
- when Hash
258
- (name[:rerdoc] || "rerdoc").to_s
259
- else
260
- "re#{name}"
237
+ when Hash then (name[:rerdoc] || "rerdoc").to_s
238
+ else "re#{name}"
261
239
  end
262
240
  end
263
241
 
@@ -0,0 +1,130 @@
1
+ ##
2
+ # Methods for manipulating comment text
3
+
4
+ module RDoc::Text
5
+
6
+ ##
7
+ # Expands tab characters in +text+ to eight spaces
8
+
9
+ def expand_tabs text
10
+ expanded = []
11
+
12
+ text.each_line do |line|
13
+ line.gsub!(/^(.{8}*?)([^\t\r\n]{0,7})\t/) do
14
+ "#{$1}#{$2}#{' ' * (8 - $2.size)}"
15
+ end until line !~ /\t/
16
+
17
+ expanded << line
18
+ end
19
+
20
+ expanded.join
21
+ end
22
+
23
+ ##
24
+ # Flush +text+ left based on the shortest line
25
+
26
+ def flush_left text
27
+ indents = []
28
+
29
+ text.each_line do |line|
30
+ indents << (line =~ /[^\s]/ || 9999)
31
+ end
32
+
33
+ indent = indents.min
34
+
35
+ flush = []
36
+
37
+ text.each_line do |line|
38
+ line[/^ {0,#{indent}}/] = ''
39
+ flush << line
40
+ end
41
+
42
+ flush.join
43
+ end
44
+
45
+ ##
46
+ # Convert a string in markup format into HTML. Removes the first paragraph
47
+ # tags if +remove_para+ is true.
48
+ #
49
+ # Requires the including class to implement #formatter
50
+
51
+ def markup text
52
+ document = parse text
53
+
54
+ document.accept formatter
55
+ end
56
+
57
+ ##
58
+ # Strips hashes, expands tabs then flushes +text+ to the left
59
+
60
+ def normalize_comment text
61
+ return text if text.empty?
62
+
63
+ text = strip_hashes text
64
+ text = expand_tabs text
65
+ text = flush_left text
66
+ strip_newlines text
67
+ end
68
+
69
+ ##
70
+ # Normalizes +text+ then builds a RDoc::Markup::Document from it
71
+
72
+ def parse text
73
+ return text if RDoc::Markup::Document === text
74
+
75
+ text = normalize_comment text
76
+
77
+ return RDoc::Markup::Document.new if text =~ /\A\n*\z/
78
+
79
+ RDoc::Markup::Parser.parse text
80
+ rescue RDoc::Markup::Parser::Error => e
81
+ $stderr.puts <<-EOF
82
+ While parsing markup, RDoc encountered a #{e.class}:
83
+
84
+ #{e}
85
+ \tfrom #{e.backtrace.join "\n\tfrom "}
86
+
87
+ ---8<---
88
+ #{text}
89
+ ---8<---
90
+
91
+ RDoc #{RDoc::VERSION}
92
+
93
+ Ruby #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} #{RUBY_RELEASE_DATE}
94
+
95
+ Please file a bug report with the above information at:
96
+
97
+ http://rubyforge.org/tracker/?atid=2472&group_id=627&func=browse
98
+
99
+ EOF
100
+ raise
101
+ end
102
+
103
+ ##
104
+ # Strips leading # characters from +text+
105
+
106
+ def strip_hashes text
107
+ return text if text =~ /^(?>\s*)[^\#]/
108
+ text.gsub(/^\s*(#+)/) { $1.tr '#',' ' }
109
+ end
110
+
111
+ ##
112
+ # Strips leading and trailing \n characters from +text+
113
+
114
+ def strip_newlines text
115
+ text.gsub(/\A\n*(.*?)\n*\z/m, '\1')
116
+ end
117
+
118
+ ##
119
+ # Strips /* */ style comments
120
+
121
+ def strip_stars text
122
+ text = text.gsub %r%Document-method:\s+[\w:.#]+%, ''
123
+ text.sub! %r%/\*+% do " " * $&.length end
124
+ text.sub! %r%\*+/% do " " * $&.length end
125
+ text.gsub! %r%^[ \t]*\*%m do " " * $&.length end
126
+ text
127
+ end
128
+
129
+ end
130
+
@@ -9,25 +9,44 @@ module RDoc; end
9
9
 
10
10
  module RDoc::TokenStream
11
11
 
12
- def token_stream
13
- @token_stream
12
+ ##
13
+ # Adds +tokens+ to the collected tokens
14
+
15
+ def add_tokens(*tokens)
16
+ tokens.flatten.each { |token| @token_stream << token }
14
17
  end
15
18
 
16
- def start_collecting_tokens
19
+ alias add_token add_tokens
20
+
21
+ ##
22
+ # Starts collecting tokens
23
+
24
+ def collect_tokens
17
25
  @token_stream = []
18
26
  end
19
27
 
20
- def add_token(tk)
21
- @token_stream << tk
22
- end
28
+ alias start_collecting_tokens collect_tokens
23
29
 
24
- def add_tokens(tks)
25
- tks.each {|tk| add_token(tk)}
26
- end
30
+ ##
31
+ # Remove the last token from the collected tokens
27
32
 
28
33
  def pop_token
29
34
  @token_stream.pop
30
35
  end
31
36
 
37
+ ##
38
+ # Current token stream
39
+
40
+ def token_stream
41
+ @token_stream
42
+ end
43
+
44
+ ##
45
+ # Returns a string representation of the token stream
46
+
47
+ def tokens_to_s
48
+ token_stream.map { |token| token.text }.join ''
49
+ end
50
+
32
51
  end
33
52
 
@@ -1,4 +1,3 @@
1
- require 'thread'
2
1
  require 'rdoc/context'
3
2
 
4
3
  ##
@@ -67,40 +66,49 @@ class RDoc::TopLevel < RDoc::Context
67
66
  # Finds the class with +name+ in all discovered classes
68
67
 
69
68
  def self.find_class_named(name)
70
- @lock.synchronize do
71
- classes_hash.values.find do |c|
72
- c.find_class_named name
73
- end
74
- end
69
+ classes_hash[name]
75
70
  end
76
71
 
77
72
  ##
78
- # Finds the file with +name+ in all discovered files
73
+ # Finds the class with +name+ starting in namespace +from+
79
74
 
80
- def self.find_file_named(name)
81
- @lock.synchronize do
82
- @all_files[name]
75
+ def self.find_class_named_from name, from
76
+ from = find_class_named from unless RDoc::Context === from
77
+
78
+ until RDoc::TopLevel === from do
79
+ return nil unless from
80
+
81
+ klass = from.find_class_named name
82
+ return klass if klass
83
+
84
+ from = from.parent
83
85
  end
86
+
87
+ find_class_named name
84
88
  end
85
89
 
86
90
  ##
87
- # Finds the module with +name+ in all discovered modules
91
+ # Finds the class or module with +name+
88
92
 
89
- def self.find_module_named(name)
90
- @lock.synchronize do
91
- modules_hash.values.find do |c|
92
- c.find_module_named name
93
- end
94
- end
93
+ def self.find_class_or_module(name)
94
+ name =~ /^::/
95
+ name = $' || name
96
+
97
+ RDoc::TopLevel.classes_hash[name] || RDoc::TopLevel.modules_hash[name]
95
98
  end
96
99
 
97
- @lock = Mutex.new
100
+ ##
101
+ # Finds the file with +name+ in all discovered files
102
+
103
+ def self.find_file_named(name)
104
+ @all_files[name]
105
+ end
98
106
 
99
107
  ##
100
- # Lock for global class, module and file stores
108
+ # Finds the module with +name+ in all discovered modules
101
109
 
102
- def self.lock
103
- @lock
110
+ def self.find_module_named(name)
111
+ modules_hash[name]
104
112
  end
105
113
 
106
114
  ##
@@ -121,11 +129,9 @@ class RDoc::TopLevel < RDoc::Context
121
129
  # Empties RDoc of stored class, module and file information
122
130
 
123
131
  def self.reset
124
- @lock.synchronize do
125
- @all_classes = {}
126
- @all_modules = {}
127
- @all_files = {}
128
- end
132
+ @all_classes = {}
133
+ @all_modules = {}
134
+ @all_files = {}
129
135
  end
130
136
 
131
137
  reset
@@ -142,9 +148,7 @@ class RDoc::TopLevel < RDoc::Context
142
148
  @diagram = nil
143
149
  @parser = nil
144
150
 
145
- RDoc::TopLevel.lock.synchronize do
146
- RDoc::TopLevel.files_hash[file_name] = self
147
- end
151
+ RDoc::TopLevel.files_hash[file_name] = self
148
152
  end
149
153
 
150
154
  ##
@@ -165,33 +169,24 @@ class RDoc::TopLevel < RDoc::Context
165
169
  end
166
170
 
167
171
  ##
168
- # Find class or module named +symbol+ in all discovered classes and
169
- # modules
170
-
171
- def find_class_or_module_named(symbol)
172
- RDoc::TopLevel.classes_hash.each_value do |c|
173
- return c if c.full_name == symbol
174
- end
175
-
176
- RDoc::TopLevel.modules_hash.each_value do |m|
177
- return m if m.full_name == symbol
178
- end
172
+ # See RDoc::TopLevel.find_class_or_module
179
173
 
180
- nil
174
+ def find_class_or_module name
175
+ RDoc::TopLevel.find_class_or_module name
181
176
  end
182
177
 
183
178
  ##
184
179
  # Finds a class or module named +symbol+
185
180
 
186
181
  def find_local_symbol(symbol)
187
- find_class_or_module_named(symbol) || super
182
+ find_class_or_module(symbol) || super
188
183
  end
189
184
 
190
185
  ##
191
186
  # Finds a module or class with +name+
192
187
 
193
188
  def find_module_named(name)
194
- find_class_or_module_named(name) || find_enclosing_module_named(name)
189
+ find_class_or_module(name) || find_enclosing_module_named(name)
195
190
  end
196
191
 
197
192
  ##
@@ -238,5 +233,16 @@ class RDoc::TopLevel < RDoc::Context
238
233
  http_url RDoc::RDoc.current.generator.file_dir
239
234
  end
240
235
 
236
+ def pretty_print q # :nodoc:
237
+ q.group 2, "[#{self.class}: ", "]" do
238
+ q.text "base name: #{base_name.inspect}"
239
+ q.breakable
240
+
241
+ items = @modules.map { |n,m| m }
242
+ items.push(*@modules.map { |n,c| c })
243
+ q.seplist items do |mod| q.pp mod end
244
+ end
245
+ end
246
+
241
247
  end
242
248