diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-18 23:33:36 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-18 23:33:36 +0000 |
commit | df7dac9174a31e71b58be6184e23bfe6b742a494 (patch) | |
tree | 885edf624f0e8f37014b0d937340ac1c372a0066 /lib/rdoc/class_module.rb | |
parent | fed428007c015ac3b7f4586f2491517fafffa030 (diff) |
* lib/rdoc: Update to RDoc 4.1.0.preview.1
RDoc 4.1.0 contains a number of enhancements including a new default
style and accessibility support. You can see the changelog here:
https://github.com/rdoc/rdoc/blob/v4.1.0.preview.1/History.rdoc
* test/rdoc: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/class_module.rb')
-rw-r--r-- | lib/rdoc/class_module.rb | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/lib/rdoc/class_module.rb b/lib/rdoc/class_module.rb index b796050431..71566f050a 100644 --- a/lib/rdoc/class_module.rb +++ b/lib/rdoc/class_module.rb @@ -169,6 +169,18 @@ class RDoc::ClassModule < RDoc::Context includes.map { |i| i.module }.reverse end + def aref_prefix # :nodoc: + raise NotImplementedError, "missing aref_prefix for #{self.class}" + end + + ## + # HTML fragment reference for this module or class. See + # RDoc::NormalClass#aref and RDoc::NormalModule#aref + + def aref + "#{aref_prefix}-#{full_name}" + end + ## # Ancestors of this class or module only @@ -224,7 +236,9 @@ class RDoc::ClassModule < RDoc::Context # #received_nodoc true? def documented? - super or !@comment_location.empty? + return true if @received_nodoc + return false if @comment_location.empty? + @comment_location.any? { |comment, _| not comment.empty? } end ## @@ -282,16 +296,18 @@ class RDoc::ClassModule < RDoc::Context def marshal_dump # :nodoc: attrs = attributes.sort.map do |attr| + next unless attr.display? [ attr.name, attr.rw, attr.visibility, attr.singleton, attr.file_name, ] - end + end.compact method_types = methods_by_type.map do |type, visibilities| visibilities = visibilities.map do |visibility, methods| method_names = methods.map do |method| + next unless method.display? [method.name, method.file_name] - end + end.compact [visibility, method_names.uniq] end @@ -305,14 +321,16 @@ class RDoc::ClassModule < RDoc::Context @superclass, parse(@comment_location), attrs, - constants, + constants.select { |constant| constant.display? }, includes.map do |incl| + next unless incl.display? [incl.name, parse(incl.comment), incl.file_name] - end, + end.compact, method_types, extends.map do |ext| + next unless ext.display? [ext.name, parse(ext.comment), ext.file_name] - end, + end.compact, @sections.values, @in_files.map do |tl| tl.relative_name |