diff options
Diffstat (limited to 'lib/rdoc/ri/driver.rb')
-rw-r--r-- | lib/rdoc/ri/driver.rb | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/lib/rdoc/ri/driver.rb b/lib/rdoc/ri/driver.rb index 26304dca96..a99f96cb56 100644 --- a/lib/rdoc/ri/driver.rb +++ b/lib/rdoc/ri/driver.rb @@ -387,8 +387,6 @@ 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 @@ -453,7 +451,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 if methods.empty? + return unless methods out << RDoc::Markup::Heading.new(1, "#{name}:") out << RDoc::Markup::BlankLine.new @@ -520,13 +518,11 @@ Options may also be set in the 'RI' environment variable. found.each do |store, klass| comment = klass.comment - # 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] || [] + 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.empty? and class_methods.empty? then + if comment.empty? and !(instance_methods or class_methods) then also_in << store next end @@ -535,17 +531,7 @@ Options may also be set in the 'RI' environment variable. unless comment.empty? then out << RDoc::Markup::Rule.new(1) - - 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 + out << comment end if class_methods or instance_methods or not klass.constants.empty? then @@ -568,12 +554,13 @@ 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 @@ -1103,11 +1090,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 |