diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-31 00:19:00 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-31 00:19:00 +0000 |
commit | 89b601d176a64f1293a3d3b5195b6735cbf880af (patch) | |
tree | c7f148e8cf8576202220ce567dc8b9a698e4b114 /lib/rdoc/code_object.rb | |
parent | 4ac69a57b5e8587a321b052212ae5b9bedeafe55 (diff) | |
download | ruby-89b601d176a64f1293a3d3b5195b6735cbf880af.tar.gz |
* lib/rdoc: Update to RDoc 3.9. Fixed `ri []`, stopdoc creating an
object reference, nodoc for class aliases, verbatim === lines.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/code_object.rb')
-rw-r--r-- | lib/rdoc/code_object.rb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/rdoc/code_object.rb b/lib/rdoc/code_object.rb index 606fd8ff49..54826fffbd 100644 --- a/lib/rdoc/code_object.rb +++ b/lib/rdoc/code_object.rb @@ -114,6 +114,7 @@ class RDoc::CodeObject @done_documenting = false @force_documentation = false @received_nodoc = false + @ignored = false end ## @@ -140,6 +141,13 @@ class RDoc::CodeObject end ## + # Should this CodeObject be shown in documentation? + + def display? + @document_self and not @ignored + end + + ## # Enables or disables documentation of this CodeObject's children unless it # has been turned off by :enddoc: @@ -195,6 +203,11 @@ class RDoc::CodeObject self end + ## + # File name where this CodeObject was found. + # + # See also RDoc::Context#in_files + def file_name return unless @file @@ -221,6 +234,34 @@ class RDoc::CodeObject end ## + # Use this to ignore a CodeObject and all its children until found again + # (#record_location is called). An ignored item will not be shown in + # documentation. + # + # See github issue #55 + # + # The ignored status is temporary in order to allow implementation details + # to be hidden. At the end of processing a file RDoc allows all classes + # and modules to add new documentation to previously created classes. + # + # If a class was ignored (via stopdoc) then reopened later with additional + # documentation it should be shown. If a class was ignored and never + # reopened it should not be shown. The ignore flag allows this to occur. + + def ignore + @ignored = true + + stop_doc + end + + ## + # Has this class been ignored? + + def ignored? + @ignored + end + + ## # File name of our parent def parent_file_name @@ -238,6 +279,7 @@ class RDoc::CodeObject # Records the RDoc::TopLevel (file) where this code object was defined def record_location top_level + @ignored = false @file = top_level end @@ -250,6 +292,7 @@ class RDoc::CodeObject @document_self = true @document_children = true + @ignored = false end ## |