diff --git a/ChangeLog b/ChangeLog index 59fe229816..37c91a662b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +Wed Dec 12 14:16:35 2012 Eric Hodel + + * lib/rdoc/class_module.rb: Added RDoc::ClassModule#documented? which + checks comment_location. Hide RDoc::ClassModule#comment=. + * test/rdoc/test_rdoc_class_module.rb: Test for above. + + * lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml: + Fix display of the table of contents in the sidebar. + + * lib/rdoc/generator/template/darkfish/table_of_contents.rhtml: + Use #comment_location when displaying classes or modules. + + * test/rdoc/test_rdoc_store.rb: Use comment_location. + Wed Dec 12 13:40:52 2012 Nobuyoshi Nakada * vm_insnhelper.c (vm_getivar): no uninitialized instance variables diff --git a/lib/rdoc/class_module.rb b/lib/rdoc/class_module.rb index e2bb9de68d..a520503598 100644 --- a/lib/rdoc/class_module.rb +++ b/lib/rdoc/class_module.rb @@ -184,7 +184,7 @@ class RDoc::ClassModule < RDoc::Context # Appends +comment+ to the current comment, but separated by a rule. Works # more like +=. - def comment= comment + def comment= comment # :nodoc: comment = case comment when RDoc::Comment then comment.normalize @@ -216,6 +216,14 @@ class RDoc::ClassModule < RDoc::Context document_self || method_list.any?{ |m| m.document_self } end + ## + # Does this class or module have a comment with content or is + # #received_nodoc true? + + def documented? + super or !@comment_location.empty? + end + ## # Iterates the ancestors of this class or module for which an # RDoc::ClassModule exists. diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml index 225f811f0e..7842625840 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml @@ -1,4 +1,10 @@ -<% table = current.parse(current.comment).table_of_contents +<% comment = if current.respond_to? :comment_location then + current.comment_location + else + current.comment + end + table = current.parse(comment).table_of_contents + if table.length > 1 then %>