summaryrefslogtreecommitdiff
path: root/lib/rdoc/ri
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-31 00:19:00 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-31 00:19:00 +0000
commit89b601d176a64f1293a3d3b5195b6735cbf880af (patch)
treec7f148e8cf8576202220ce567dc8b9a698e4b114 /lib/rdoc/ri
parent4ac69a57b5e8587a321b052212ae5b9bedeafe55 (diff)
* lib/rdoc: Update to RDoc 3.9. Fixed `ri []`, stopdoc creating an
object reference, nodoc for class aliases, verbatim === lines. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/ri')
-rw-r--r--lib/rdoc/ri/driver.rb33
1 files changed, 23 insertions, 10 deletions
diff --git a/lib/rdoc/ri/driver.rb b/lib/rdoc/ri/driver.rb
index a99f96cb56..26304dca96 100644
--- a/lib/rdoc/ri/driver.rb
+++ b/lib/rdoc/ri/driver.rb
@@ -387,6 +387,8 @@ Options may also be set in the 'RI' environment variable.
klass.superclass unless klass.module?
end.compact.shift || 'Object'
+ superclass = superclass.full_name unless String === superclass
+
"#{name} < #{superclass}"
end
@@ -451,7 +453,7 @@ Options may also be set in the 'RI' environment variable.
# Adds a list of +methods+ to +out+ with a heading of +name+
def add_method_list out, methods, name
- return unless methods
+ return if methods.empty?
out << RDoc::Markup::Heading.new(1, "#{name}:")
out << RDoc::Markup::BlankLine.new
@@ -518,11 +520,13 @@ Options may also be set in the 'RI' environment variable.
found.each do |store, klass|
comment = klass.comment
- class_methods = store.class_methods[klass.full_name]
- instance_methods = store.instance_methods[klass.full_name]
- attributes = store.attributes[klass.full_name]
+ # TODO the store's cache should always return an empty Array
+ class_methods = store.class_methods[klass.full_name] || []
+ instance_methods = store.instance_methods[klass.full_name] || []
+ attributes = store.attributes[klass.full_name] || []
- if comment.empty? and !(instance_methods or class_methods) then
+ if comment.empty? and
+ instance_methods.empty? and class_methods.empty? then
also_in << store
next
end
@@ -531,7 +535,17 @@ Options may also be set in the 'RI' environment variable.
unless comment.empty? then
out << RDoc::Markup::Rule.new(1)
- out << comment
+
+ if comment.merged? then
+ parts = comment.parts
+ parts = parts.zip [RDoc::Markup::BlankLine.new] * parts.length
+ parts.flatten!
+ parts.pop
+
+ out.push(*parts)
+ else
+ out << comment
+ end
end
if class_methods or instance_methods or not klass.constants.empty? then
@@ -554,13 +568,12 @@ Options may also be set in the 'RI' environment variable.
end)
out << list
+ out << RDoc::Markup::BlankLine.new
end
add_method_list out, class_methods, 'Class methods'
add_method_list out, instance_methods, 'Instance methods'
add_method_list out, attributes, 'Attributes'
-
- out << RDoc::Markup::BlankLine.new
end
add_also_in out, also_in
@@ -1090,11 +1103,11 @@ Options may also be set in the 'RI' environment variable.
# NOTE: Given Foo::Bar, Bar is considered a class even though it may be a
# method
- def parse_name(name)
+ def parse_name name
parts = name.split(/(::|#|\.)/)
if parts.length == 1 then
- if parts.first =~ /^[a-z]/ then
+ if parts.first =~ /^[a-z]|^([%&*+\/<>^`|~-]|\+@|-@|<<|<=>?|===?|=>|=~|>>|\[\]=?|~@)$/ then
type = '.'
meth = parts.pop
else