Refactor RDoc filters

pull/15/head
Thibaut 11 years ago
parent 4f2719e8b2
commit 07d8d1ac0f

@ -11,7 +11,7 @@ module Docs
meta = Nokogiri::XML::Node.new 'dl', doc meta = Nokogiri::XML::Node.new 'dl', doc
meta['class'] = 'meta' meta['class'] = 'meta'
if parent = at_css('#parent-class-section') if parent = at_css('#parent-class-section')
meta << %(<dt>Parent:</dt><dd class="meta-parent">#{parent.at_css('.link').inner_html}</dd>) meta << %(<dt>Parent:</dt><dd class="meta-parent">#{parent.at_css('.link').inner_html.strip}</dd>)
end end
if includes = at_css('#includes-section') if includes = at_css('#includes-section')
meta << %(<dt>Included modules:</dt><dd class="meta-includes">#{includes.css('a').map(&:to_html).join(', ')}</dd>) meta << %(<dt>Included modules:</dt><dd class="meta-includes">#{includes.css('a').map(&:to_html).join(', ')}</dd>)

@ -12,7 +12,7 @@ module Docs
type = name.dup type = name.dup
unless type.sub! %r{::.*\z}, '' unless type.sub! %r{::.*\z}, ''
parent = at_css('.meta-parent').try(:content).to_s.strip parent = at_css('.meta-parent').try(:content).to_s
return 'Errors' if type.end_with?('Error') || parent.end_with?('Error') || parent.end_with?('Exception') return 'Errors' if type.end_with?('Error') || parent.end_with?('Error') || parent.end_with?('Exception')
end end

Loading…
Cancel
Save