rdoc 6.8.1 → 6.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rdoc/code_object/alias.rb +2 -9
  3. data/lib/rdoc/code_object/any_method.rb +7 -12
  4. data/lib/rdoc/code_object/attr.rb +4 -7
  5. data/lib/rdoc/code_object/class_module.rb +53 -20
  6. data/lib/rdoc/code_object/constant.rb +1 -1
  7. data/lib/rdoc/code_object/context/section.rb +10 -68
  8. data/lib/rdoc/code_object/context.rb +4 -46
  9. data/lib/rdoc/code_object/method_attr.rb +16 -24
  10. data/lib/rdoc/code_object/require.rb +1 -1
  11. data/lib/rdoc/code_object/top_level.rb +6 -24
  12. data/lib/rdoc/code_object.rb +3 -35
  13. data/lib/rdoc/comment.rb +12 -5
  14. data/lib/rdoc/generator/darkfish.rb +92 -108
  15. data/lib/rdoc/generator/json_index.rb +1 -17
  16. data/lib/rdoc/generator/markup.rb +2 -2
  17. data/lib/rdoc/generator/pot/message_extractor.rb +2 -2
  18. data/lib/rdoc/generator/pot.rb +0 -5
  19. data/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +1 -29
  20. data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +1 -1
  21. data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +1 -1
  22. data/lib/rdoc/generator/template/darkfish/class.rhtml +15 -0
  23. data/lib/rdoc/generator/template/darkfish/css/rdoc.css +40 -21
  24. data/lib/rdoc/generator/template/darkfish/index.rhtml +4 -4
  25. data/lib/rdoc/generator/template/darkfish/js/darkfish.js +7 -1
  26. data/lib/rdoc/markdown.kpeg +7 -5
  27. data/lib/rdoc/markdown.rb +34 -21
  28. data/lib/rdoc/markup/formatter.rb +19 -12
  29. data/lib/rdoc/markup/heading.rb +7 -1
  30. data/lib/rdoc/markup/pre_process.rb +17 -0
  31. data/lib/rdoc/markup/to_html.rb +7 -2
  32. data/lib/rdoc/markup/to_html_crossref.rb +63 -12
  33. data/lib/rdoc/markup/to_rdoc.rb +1 -1
  34. data/lib/rdoc/options.rb +68 -7
  35. data/lib/rdoc/parser/c.rb +29 -8
  36. data/lib/rdoc/parser/changelog.rb +3 -2
  37. data/lib/rdoc/parser/prism_ruby.rb +1092 -0
  38. data/lib/rdoc/parser/ruby.rb +8 -11
  39. data/lib/rdoc/parser/simple.rb +1 -1
  40. data/lib/rdoc/parser.rb +3 -3
  41. data/lib/rdoc/rd/block_parser.rb +3 -3
  42. data/lib/rdoc/rd/inline_parser.rb +3 -3
  43. data/lib/rdoc/rdoc.rb +6 -19
  44. data/lib/rdoc/ri/driver.rb +75 -26
  45. data/lib/rdoc/rubygems_hook.rb +91 -15
  46. data/lib/rdoc/servlet.rb +8 -7
  47. data/lib/rdoc/stats.rb +2 -2
  48. data/lib/rdoc/store.rb +21 -13
  49. data/lib/rdoc/text.rb +2 -2
  50. data/lib/rdoc/version.rb +1 -1
  51. data/lib/rdoc.rb +0 -2
  52. data/lib/rubygems_plugin.rb +23 -0
  53. metadata +5 -10
  54. data/lib/rdoc/generator/template/darkfish/.document +0 -0
  55. data/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml +0 -19
  56. data/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +0 -9
  57. data/lib/rdoc/generator/template/json_index/.document +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab7104c0fad9d27075157ea14f872e0cc64198e968a78806159ca9bb04818c89
4
- data.tar.gz: ba3d5c7d17c8a5940082cf0d5a34398b02827cb8b306227dd859680e9b062d50
3
+ metadata.gz: 8d37c61d3b62301d9edb9907e9d479ed46ee9c930ef642ab50c5a8ef9793aa6c
4
+ data.tar.gz: 987db79f9426bf33980775d980fc0ea36f527f74dd2098433450ee18a3ab1715
5
5
  SHA512:
6
- metadata.gz: 224282c81f12e1496f6a8095a439169cc7e47d6a71261cf537676798fcd2aec436277c1f5d5fc5ca772ac9ec11842c189b8e91fbe469fcf8a0d668c47ace22ba
7
- data.tar.gz: 4e77eeaa209030e5ad6c6d6fed56aacdd3ddff916ddf69216fc2454c0ae5acb8c861d367ca14f90290929702529490dabf416622270c14aa94c9bd44b69f17af
6
+ metadata.gz: f6afade46cb94e3cbd3d595d49ae76d41b07a4c987e4a30159558caf368453628ddf7f790c9eeb0d95023323f5ff63c2e64df8ec99b1fb87a1b490bc42feb23b
7
+ data.tar.gz: 8e7e146ab28264fc33223f1e31c38985844718bc679aa7c11e0daef73edef93325f322c60fc1b78d5182d426ef972b6f685b31010f55f5e02be2d0a333972eb0
@@ -23,7 +23,7 @@ class RDoc::Alias < RDoc::CodeObject
23
23
  ##
24
24
  # Is this an alias declared in a singleton context?
25
25
 
26
- attr_accessor :singleton
26
+ attr_reader :singleton
27
27
 
28
28
  ##
29
29
  # Source file token stream
@@ -34,7 +34,7 @@ class RDoc::Alias < RDoc::CodeObject
34
34
  # Creates a new Alias with a token stream of +text+ that aliases +old_name+
35
35
  # to +new_name+, has +comment+ and is a +singleton+ context.
36
36
 
37
- def initialize(text, old_name, new_name, comment, singleton = false)
37
+ def initialize(text, old_name, new_name, comment, singleton: false)
38
38
  super()
39
39
 
40
40
  @text = text
@@ -59,13 +59,6 @@ class RDoc::Alias < RDoc::CodeObject
59
59
  "#alias-#{type}-#{html_name}"
60
60
  end
61
61
 
62
- ##
63
- # Full old name including namespace
64
-
65
- def full_old_name
66
- @full_name || "#{parent.name}#{pretty_old_name}"
67
- end
68
-
69
62
  ##
70
63
  # HTML id-friendly version of +#new_name+.
71
64
 
@@ -29,10 +29,6 @@ class RDoc::AnyMethod < RDoc::MethodAttr
29
29
  # The section title of the method (if defined in a C file via +:category:+)
30
30
  attr_accessor :section_title
31
31
 
32
- # Parameters for this method
33
-
34
- attr_accessor :params
35
-
36
32
  ##
37
33
  # If true this method uses +super+ to call a superclass version
38
34
 
@@ -43,8 +39,8 @@ class RDoc::AnyMethod < RDoc::MethodAttr
43
39
  ##
44
40
  # Creates a new AnyMethod with a token stream +text+ and +name+
45
41
 
46
- def initialize text, name
47
- super
42
+ def initialize(text, name, singleton: false)
43
+ super(text, name, singleton: singleton)
48
44
 
49
45
  @c_function = nil
50
46
  @dont_rename_initialize = false
@@ -57,10 +53,9 @@ class RDoc::AnyMethod < RDoc::MethodAttr
57
53
  # Adds +an_alias+ as an alias for this method in +context+.
58
54
 
59
55
  def add_alias an_alias, context = nil
60
- method = self.class.new an_alias.text, an_alias.new_name
56
+ method = self.class.new an_alias.text, an_alias.new_name, singleton: singleton
61
57
 
62
58
  method.record_location an_alias.file
63
- method.singleton = self.singleton
64
59
  method.params = self.params
65
60
  method.visibility = self.visibility
66
61
  method.comment = an_alias.comment
@@ -110,7 +105,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
110
105
  # See also #param_seq
111
106
 
112
107
  def call_seq= call_seq
113
- return if call_seq.empty?
108
+ return if call_seq.nil? || call_seq.empty?
114
109
 
115
110
  @call_seq = call_seq
116
111
  end
@@ -198,7 +193,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
198
193
  @full_name = array[2]
199
194
  @singleton = array[3]
200
195
  @visibility = array[4]
201
- @comment = array[5]
196
+ @comment = RDoc::Comment.from_document array[5]
202
197
  @call_seq = array[6]
203
198
  @block_params = array[7]
204
199
  # 8 handled below
@@ -210,8 +205,8 @@ class RDoc::AnyMethod < RDoc::MethodAttr
210
205
  @section_title = array[14]
211
206
  @is_alias_for = array[15]
212
207
 
213
- array[8].each do |new_name, comment|
214
- add_alias RDoc::Alias.new(nil, @name, new_name, comment, @singleton)
208
+ array[8].each do |new_name, document|
209
+ add_alias RDoc::Alias.new(nil, @name, new_name, RDoc::Comment.from_document(document), singleton: @singleton)
215
210
  end
216
211
 
217
212
  @parent_name ||= if @full_name =~ /#/ then
@@ -22,11 +22,10 @@ class RDoc::Attr < RDoc::MethodAttr
22
22
  # Creates a new Attr with body +text+, +name+, read/write status +rw+ and
23
23
  # +comment+. +singleton+ marks this as a class attribute.
24
24
 
25
- def initialize(text, name, rw, comment, singleton = false)
26
- super text, name
25
+ def initialize(text, name, rw, comment, singleton: false)
26
+ super(text, name, singleton: singleton)
27
27
 
28
28
  @rw = rw
29
- @singleton = singleton
30
29
  self.comment = comment
31
30
  end
32
31
 
@@ -44,9 +43,7 @@ class RDoc::Attr < RDoc::MethodAttr
44
43
  # Add +an_alias+ as an attribute in +context+.
45
44
 
46
45
  def add_alias(an_alias, context)
47
- new_attr = self.class.new(self.text, an_alias.new_name, self.rw,
48
- self.comment, self.singleton)
49
-
46
+ new_attr = self.class.new(text, an_alias.new_name, rw, comment, singleton: singleton)
50
47
  new_attr.record_location an_alias.file
51
48
  new_attr.visibility = self.visibility
52
49
  new_attr.is_alias_for = self
@@ -136,7 +133,7 @@ class RDoc::Attr < RDoc::MethodAttr
136
133
  @full_name = array[2]
137
134
  @rw = array[3]
138
135
  @visibility = array[4]
139
- @comment = array[5]
136
+ @comment = RDoc::Comment.from_document array[5]
140
137
  @singleton = array[6] || false # MARSHAL_VERSION == 0
141
138
  # 7 handled below
142
139
  @parent_name = array[8]
@@ -34,8 +34,6 @@ class RDoc::ClassModule < RDoc::Context
34
34
 
35
35
  attr_accessor :comment_location
36
36
 
37
- attr_accessor :diagram # :nodoc:
38
-
39
37
  ##
40
38
  # Class or module this constant is an alias for
41
39
 
@@ -56,7 +54,6 @@ class RDoc::ClassModule < RDoc::Context
56
54
 
57
55
  klass.parent = mod.parent
58
56
  klass.section = mod.section
59
- klass.viewer = mod.viewer
60
57
 
61
58
  klass.attributes.concat mod.attributes
62
59
  klass.method_list.concat mod.method_list
@@ -110,7 +107,6 @@ class RDoc::ClassModule < RDoc::Context
110
107
 
111
108
  def initialize(name, superclass = nil)
112
109
  @constant_aliases = []
113
- @diagram = nil
114
110
  @is_alias_for = nil
115
111
  @name = name
116
112
  @superclass = superclass
@@ -225,6 +221,7 @@ class RDoc::ClassModule < RDoc::Context
225
221
  remove_nodoc_children
226
222
  embed_mixins
227
223
  update_includes
224
+ update_extends
228
225
  remove_invisible min_visibility
229
226
  end
230
227
 
@@ -295,6 +292,25 @@ class RDoc::ClassModule < RDoc::Context
295
292
  end
296
293
  end
297
294
 
295
+ ##
296
+ # Return array of full_name splitted by +::+.
297
+
298
+ def nesting_namespaces
299
+ @namespaces ||= full_name.split("::").reject(&:empty?)
300
+ end
301
+
302
+ ##
303
+ # Return array of fully qualified nesting namespaces.
304
+ #
305
+ # For example, if full_name is +A::B::C+, this method returns <code>["A", "A::B", "A::B::C"]</code>
306
+
307
+ def fully_qualified_nesting_namespaces
308
+ return nesting_namespaces if nesting_namespaces.length < 2
309
+ @fqns ||= nesting_namespaces.inject([]) do |list, n|
310
+ list << (list.empty? ? n : "#{list.last}::#{n}")
311
+ end
312
+ end
313
+
298
314
  ##
299
315
  # TODO: filter included items by #display?
300
316
 
@@ -359,37 +375,39 @@ class RDoc::ClassModule < RDoc::Context
359
375
  @name = array[1]
360
376
  @full_name = array[2]
361
377
  @superclass = array[3]
362
- @comment = array[4]
378
+ document = array[4]
379
+
380
+ @comment = RDoc::Comment.from_document document
363
381
 
364
- @comment_location = if RDoc::Markup::Document === @comment.parts.first then
365
- @comment
382
+ @comment_location = if RDoc::Markup::Document === document.parts.first then
383
+ document
366
384
  else
367
- RDoc::Markup::Document.new @comment
385
+ RDoc::Markup::Document.new document
368
386
  end
369
387
 
370
388
  array[5].each do |name, rw, visibility, singleton, file|
371
389
  singleton ||= false
372
390
  visibility ||= :public
373
391
 
374
- attr = RDoc::Attr.new nil, name, rw, nil, singleton
392
+ attr = RDoc::Attr.new nil, name, rw, nil, singleton: singleton
375
393
 
376
394
  add_attribute attr
377
395
  attr.visibility = visibility
378
396
  attr.record_location RDoc::TopLevel.new file
379
397
  end
380
398
 
381
- array[6].each do |constant, comment, file|
399
+ array[6].each do |constant, document, file|
382
400
  case constant
383
401
  when RDoc::Constant then
384
402
  add_constant constant
385
403
  else
386
- constant = add_constant RDoc::Constant.new(constant, nil, comment)
404
+ constant = add_constant RDoc::Constant.new(constant, nil, RDoc::Comment.from_document(document))
387
405
  constant.record_location RDoc::TopLevel.new file
388
406
  end
389
407
  end
390
408
 
391
- array[7].each do |name, comment, file|
392
- incl = add_include RDoc::Include.new(name, comment)
409
+ array[7].each do |name, document, file|
410
+ incl = add_include RDoc::Include.new(name, RDoc::Comment.from_document(document))
393
411
  incl.record_location RDoc::TopLevel.new file
394
412
  end
395
413
 
@@ -398,16 +416,15 @@ class RDoc::ClassModule < RDoc::Context
398
416
  @visibility = visibility
399
417
 
400
418
  methods.each do |name, file|
401
- method = RDoc::AnyMethod.new nil, name
402
- method.singleton = true if type == 'class'
419
+ method = RDoc::AnyMethod.new nil, name, singleton: type == 'class'
403
420
  method.record_location RDoc::TopLevel.new file
404
421
  add_method method
405
422
  end
406
423
  end
407
424
  end
408
425
 
409
- array[9].each do |name, comment, file|
410
- ext = add_extend RDoc::Extend.new(name, comment)
426
+ array[9].each do |name, document, file|
427
+ ext = add_extend RDoc::Extend.new(name, RDoc::Comment.from_document(document))
411
428
  ext.record_location RDoc::TopLevel.new file
412
429
  end if array[9] # Support Marshal version 1
413
430
 
@@ -444,7 +461,8 @@ class RDoc::ClassModule < RDoc::Context
444
461
 
445
462
  document = document.merge other_document
446
463
 
447
- @comment = @comment_location = document
464
+ @comment = RDoc::Comment.from_document(document)
465
+ @comment_location = document
448
466
  end
449
467
 
450
468
  cm = class_module
@@ -612,7 +630,9 @@ class RDoc::ClassModule < RDoc::Context
612
630
  # Path to this class or module for use with HTML generator output.
613
631
 
614
632
  def path
615
- http_url @store.rdoc.generator.class_dir
633
+ prefix = options.class_module_path_prefix
634
+ return http_url unless prefix
635
+ File.join(prefix, http_url)
616
636
  end
617
637
 
618
638
  ##
@@ -705,10 +725,23 @@ class RDoc::ClassModule < RDoc::Context
705
725
 
706
726
  ##
707
727
  # Set the superclass of this class to +superclass+
728
+ #
729
+ # where +superclass+ is one of:
730
+ #
731
+ # - +nil+
732
+ # - a String containing the full name of the superclass
733
+ # - the RDoc::ClassModule representing the superclass
708
734
 
709
735
  def superclass=(superclass)
710
736
  raise NoMethodError, "#{full_name} is a module" if module?
711
- @superclass = superclass
737
+ case superclass
738
+ when RDoc::ClassModule
739
+ @superclass = superclass.full_name
740
+ when nil, String
741
+ @superclass = superclass
742
+ else
743
+ raise TypeError, "superclass must be a String or RDoc::ClassModule, not #{superclass.class}"
744
+ end
712
745
  end
713
746
 
714
747
  ##
@@ -133,7 +133,7 @@ class RDoc::Constant < RDoc::CodeObject
133
133
  # * #parent_name
134
134
 
135
135
  def marshal_load array
136
- initialize array[1], nil, array[5]
136
+ initialize array[1], nil, RDoc::Comment.from_document(array[5])
137
137
 
138
138
  @full_name = array[2]
139
139
  @visibility = array[3] || :public
@@ -61,19 +61,10 @@ class RDoc::Context::Section
61
61
  # Adds +comment+ to this section
62
62
 
63
63
  def add_comment comment
64
- comment = extract_comment comment
65
-
66
- return if comment.empty?
67
-
68
- case comment
69
- when RDoc::Comment then
70
- @comments << comment
71
- when RDoc::Markup::Document then
72
- @comments.concat comment.parts
73
- when Array then
74
- @comments.concat comment
75
- else
76
- raise TypeError, "unknown comment type: #{comment.inspect}"
64
+ comments = Array(comment)
65
+ comments.each do |c|
66
+ extracted_comment = extract_comment(c)
67
+ @comments << extracted_comment unless extracted_comment.empty?
77
68
  end
78
69
  end
79
70
 
@@ -97,10 +88,6 @@ class RDoc::Context::Section
97
88
 
98
89
  def extract_comment comment
99
90
  case comment
100
- when Array then
101
- comment.map do |c|
102
- extract_comment c
103
- end
104
91
  when nil
105
92
  RDoc::Comment.new ''
106
93
  when RDoc::Comment then
@@ -115,8 +102,6 @@ class RDoc::Context::Section
115
102
  end
116
103
  end
117
104
 
118
- comment
119
- when RDoc::Markup::Document then
120
105
  comment
121
106
  else
122
107
  raise TypeError, "unknown comment #{comment.inspect}"
@@ -135,20 +120,7 @@ class RDoc::Context::Section
135
120
  # The files comments in this section come from
136
121
 
137
122
  def in_files
138
- return [] if @comments.empty?
139
-
140
- case @comments
141
- when Array then
142
- @comments.map do |comment|
143
- comment.file
144
- end
145
- when RDoc::Markup::Document then
146
- @comment.parts.map do |document|
147
- document.file
148
- end
149
- else
150
- raise RDoc::Error, "BUG: unknown comment class #{@comments.class}"
151
- end
123
+ @comments.map(&:file)
152
124
  end
153
125
 
154
126
  ##
@@ -170,7 +142,7 @@ class RDoc::Context::Section
170
142
  @parent = nil
171
143
 
172
144
  @title = array[1]
173
- @comments = array[2]
145
+ @comments = array[2].parts.map { |doc| RDoc::Comment.from_document(doc) }
174
146
  end
175
147
 
176
148
  ##
@@ -178,26 +150,7 @@ class RDoc::Context::Section
178
150
  # multiple RDoc::Markup::Documents with their file set.
179
151
 
180
152
  def parse
181
- case @comments
182
- when String then
183
- super
184
- when Array then
185
- docs = @comments.map do |comment, location|
186
- doc = super comment
187
- doc.file = location if location
188
- doc
189
- end
190
-
191
- RDoc::Markup::Document.new(*docs)
192
- when RDoc::Comment then
193
- doc = super @comments.text, comments.format
194
- doc.file = @comments.location
195
- doc
196
- when RDoc::Markup::Document then
197
- return @comments
198
- else
199
- raise ArgumentError, "unknown comment class #{comments.class}"
200
- end
153
+ RDoc::Markup::Document.new(*@comments.map(&:parse))
201
154
  end
202
155
 
203
156
  ##
@@ -213,20 +166,9 @@ class RDoc::Context::Section
213
166
  # Removes a comment from this section if it is from the same file as
214
167
  # +comment+
215
168
 
216
- def remove_comment comment
217
- return if @comments.empty?
218
-
219
- case @comments
220
- when Array then
221
- @comments.delete_if do |my_comment|
222
- my_comment.file == comment.file
223
- end
224
- when RDoc::Markup::Document then
225
- @comments.parts.delete_if do |document|
226
- document.file == comment.file.name
227
- end
228
- else
229
- raise RDoc::Error, "BUG: unknown comment class #{@comments.class}"
169
+ def remove_comment target_comment
170
+ @comments.delete_if do |stored_comment|
171
+ stored_comment.file == target_comment.file
230
172
  end
231
173
  end
232
174
 
@@ -482,7 +482,7 @@ class RDoc::Context < RDoc::CodeObject
482
482
  known.comment = method.comment if known.comment.empty?
483
483
  previously = ", previously in #{known.file}" unless
484
484
  method.file == known.file
485
- @store.rdoc.options.warn \
485
+ @store.options.warn \
486
486
  "Duplicate method #{known.full_name} in #{method.file}#{previously}"
487
487
  end
488
488
  else
@@ -688,13 +688,6 @@ class RDoc::Context < RDoc::CodeObject
688
688
  section
689
689
  end
690
690
 
691
- ##
692
- # Is part of this thing was defined in +file+?
693
-
694
- def defined_in?(file)
695
- @in_files.include?(file)
696
- end
697
-
698
691
  def display(method_attr) # :nodoc:
699
692
  if method_attr.is_a? RDoc::Attr
700
693
  "#{method_attr.definition} #{method_attr.pretty_name}"
@@ -713,13 +706,6 @@ class RDoc::Context < RDoc::CodeObject
713
706
  def each_ancestor(&_) # :nodoc:
714
707
  end
715
708
 
716
- ##
717
- # Iterator for attributes
718
-
719
- def each_attribute # :yields: attribute
720
- @attributes.each { |a| yield a }
721
- end
722
-
723
709
  ##
724
710
  # Iterator for classes and modules
725
711
 
@@ -727,27 +713,6 @@ class RDoc::Context < RDoc::CodeObject
727
713
  classes_and_modules.sort.each(&block)
728
714
  end
729
715
 
730
- ##
731
- # Iterator for constants
732
-
733
- def each_constant # :yields: constant
734
- @constants.each {|c| yield c}
735
- end
736
-
737
- ##
738
- # Iterator for included modules
739
-
740
- def each_include # :yields: include
741
- @includes.each do |i| yield i end
742
- end
743
-
744
- ##
745
- # Iterator for extension modules
746
-
747
- def each_extend # :yields: extend
748
- @extends.each do |e| yield e end
749
- end
750
-
751
716
  ##
752
717
  # Iterator for methods
753
718
 
@@ -847,13 +812,6 @@ class RDoc::Context < RDoc::CodeObject
847
812
  end
848
813
  end
849
814
 
850
- ##
851
- # Finds a file with +name+ in this context
852
-
853
- def find_file_named name
854
- @store.find_file_named name
855
- end
856
-
857
815
  ##
858
816
  # Finds an instance method with +name+ in this context
859
817
 
@@ -871,7 +829,7 @@ class RDoc::Context < RDoc::CodeObject
871
829
  find_attribute_named(symbol) or
872
830
  find_external_alias_named(symbol) or
873
831
  find_module_named(symbol) or
874
- find_file_named(symbol)
832
+ @store.find_file_named(symbol)
875
833
  end
876
834
 
877
835
  ##
@@ -973,10 +931,10 @@ class RDoc::Context < RDoc::CodeObject
973
931
  ##
974
932
  # URL for this with a +prefix+
975
933
 
976
- def http_url(prefix)
934
+ def http_url
977
935
  path = name_for_path
978
936
  path = path.gsub(/<<\s*(\w*)/, 'from-\1') if path =~ /<</
979
- path = [prefix] + path.split('::')
937
+ path = path.split('::')
980
938
 
981
939
  File.join(*path.compact) + '.html'
982
940
  end
@@ -63,19 +63,13 @@ class RDoc::MethodAttr < RDoc::CodeObject
63
63
 
64
64
  attr_reader :arglists
65
65
 
66
- ##
67
- # Pretty parameter list for this method
68
-
69
- attr_reader :param_seq
70
-
71
-
72
66
  ##
73
67
  # Creates a new MethodAttr from token stream +text+ and method or attribute
74
68
  # name +name+.
75
69
  #
76
70
  # Usually this is called by super from a subclass.
77
71
 
78
- def initialize text, name
72
+ def initialize(text, name, singleton: false)
79
73
  super()
80
74
 
81
75
  @text = text
@@ -84,14 +78,13 @@ class RDoc::MethodAttr < RDoc::CodeObject
84
78
  @aliases = []
85
79
  @is_alias_for = nil
86
80
  @parent_name = nil
87
- @singleton = nil
81
+ @singleton = singleton
88
82
  @visibility = :public
89
83
  @see = false
90
84
 
91
85
  @arglists = nil
92
86
  @block_params = nil
93
87
  @call_seq = nil
94
- @param_seq = nil
95
88
  @params = nil
96
89
  end
97
90
 
@@ -114,8 +107,8 @@ class RDoc::MethodAttr < RDoc::CodeObject
114
107
  return unless other.respond_to?(:singleton) &&
115
108
  other.respond_to?(:name)
116
109
 
117
- [ @singleton ? 0 : 1, name] <=>
118
- [other.singleton ? 0 : 1, other.name]
110
+ [@singleton ? 0 : 1, name_ord_range, name] <=>
111
+ [other.singleton ? 0 : 1, other.name_ord_range, other.name]
119
112
  end
120
113
 
121
114
  def == other # :nodoc:
@@ -320,19 +313,6 @@ class RDoc::MethodAttr < RDoc::CodeObject
320
313
  @singleton ? '::' : '#'
321
314
  end
322
315
 
323
- ##
324
- # Name for output to HTML. For class methods the full name with a "." is
325
- # used like +SomeClass.method_name+. For instance methods the class name is
326
- # used if +context+ does not match the parent.
327
- #
328
- # This is to help prevent people from using :: to call class methods.
329
-
330
- def output_name context
331
- return "#{name_prefix}#{@name}" if context == parent
332
-
333
- "#{parent_name}#{@singleton ? '.' : '#'}#{@name}"
334
- end
335
-
336
316
  ##
337
317
  # Method/attribute name with class/instance indicator
338
318
 
@@ -415,4 +395,16 @@ class RDoc::MethodAttr < RDoc::CodeObject
415
395
  end
416
396
  end
417
397
 
398
+ def name_ord_range # :nodoc:
399
+ case name.ord
400
+ when 0..64 # anything below "A"
401
+ 1
402
+ when 91..96 # the symbols between "Z" and "a"
403
+ 2
404
+ when 123..126 # 7-bit symbols above "z": "{", "|", "}", "~"
405
+ 3
406
+ else # everythig else can be sorted as normal
407
+ 4
408
+ end
409
+ end
418
410
  end
@@ -24,7 +24,7 @@ class RDoc::Require < RDoc::CodeObject
24
24
  self.class,
25
25
  object_id,
26
26
  @name,
27
- parent_file_name,
27
+ @parent ? @parent.base_name : '(unknown)'
28
28
  ]
29
29
  end
30
30