Skip to content

Commit 7d6c5f4

Browse files
committed
Context#each_section yields only display? items
Context#each_section yields all constants and attributes, but RDoc treats only displayed items for documentation. The Darkfish template, lib/rdoc/generator/template/darkfish/class.rhtml, it retrieves items only what #display? is true inside #each_section. It's strange behavior. I think #each_section should return only displayed items. This commit fixes it.
1 parent 1261ff6 commit 7d6c5f4

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

lib/rdoc/context.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ def each_section # :yields: section, constants, attributes
762762
attributes.default = []
763763

764764
sort_sections.each do |section|
765-
yield section, constants[section].sort, attributes[section].sort
765+
yield section, constants[section].select(&:display?).sort, attributes[section].select(&:display?).sort
766766
end
767767
end
768768

lib/rdoc/generator/template/darkfish/class.rhtml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
</section>
2727

2828
<% klass.each_section do |section, constants, attributes| %>
29-
<% constants = constants.select { |const| const.display? } %>
30-
<% attributes = attributes.select { |attr| attr.display? } %>
3129
<section id="<%= section.aref %>" class="documentation-section">
3230
<% if section.title then %>
3331
<header class="documentation-section-title">

0 commit comments

Comments
 (0)