rdoc 4.0.1 → 4.1.0.preview.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rdoc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.autotest +1 -3
- data/{DEVELOPERS.rdoc → CONTRIBUTING.rdoc} +28 -3
- data/ExampleMarkdown.md +37 -0
- data/ExampleRDoc.rdoc +208 -0
- data/History.rdoc +81 -0
- data/Manifest.txt +11 -2
- data/README.rdoc +5 -5
- data/Rakefile +34 -4
- data/lib/rdoc.rb +4 -3
- data/lib/rdoc/any_method.rb +48 -4
- data/lib/rdoc/class_module.rb +16 -2
- data/lib/rdoc/code_object.rb +85 -24
- data/lib/rdoc/comment.rb +0 -3
- data/lib/rdoc/constant.rb +9 -1
- data/lib/rdoc/context.rb +20 -2
- data/lib/rdoc/cross_reference.rb +1 -1
- data/lib/rdoc/extend.rb +4 -112
- data/lib/rdoc/generator/darkfish.rb +46 -7
- data/lib/rdoc/generator/template/darkfish/_footer.rhtml +4 -4
- data/lib/rdoc/generator/template/darkfish/_head.rhtml +14 -8
- data/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml +4 -3
- data/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +3 -3
- data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +3 -4
- data/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +4 -3
- data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +3 -4
- data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +3 -3
- data/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +4 -4
- data/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml +9 -5
- data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +5 -5
- data/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +4 -3
- data/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +12 -7
- data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +5 -4
- data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +6 -7
- data/lib/rdoc/generator/template/darkfish/class.rhtml +36 -41
- data/lib/rdoc/generator/template/darkfish/fonts.css +167 -0
- data/lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/images/add.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/arrow_up.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/delete.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/tag_blue.png +0 -0
- data/lib/rdoc/generator/template/darkfish/index.rhtml +11 -7
- data/lib/rdoc/generator/template/darkfish/js/darkfish.js +0 -15
- data/lib/rdoc/generator/template/darkfish/js/search.js +12 -4
- data/lib/rdoc/generator/template/darkfish/page.rhtml +9 -9
- data/lib/rdoc/generator/template/darkfish/rdoc.css +226 -241
- data/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +5 -5
- data/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +13 -6
- data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +17 -14
- data/lib/rdoc/include.rb +4 -114
- data/lib/rdoc/known_classes.rb +1 -0
- data/lib/rdoc/markdown.kpeg +126 -117
- data/lib/rdoc/markdown.rb +404 -389
- data/lib/rdoc/markdown/literals_1_8.kpeg +1 -1
- data/lib/rdoc/markdown/literals_1_8.rb +15 -12
- data/lib/rdoc/markdown/literals_1_9.kpeg +1 -1
- data/lib/rdoc/markdown/literals_1_9.rb +15 -12
- data/lib/rdoc/markup.rb +10 -13
- data/lib/rdoc/markup/attribute_manager.rb +3 -2
- data/lib/rdoc/markup/formatter.rb +3 -3
- data/lib/rdoc/markup/heading.rb +13 -0
- data/lib/rdoc/markup/parser.rb +10 -3
- data/lib/rdoc/markup/pre_process.rb +1 -1
- data/lib/rdoc/markup/to_html.rb +46 -31
- data/lib/rdoc/markup/to_html_crossref.rb +3 -0
- data/lib/rdoc/markup/to_joined_paragraph.rb +1 -1
- data/lib/rdoc/markup/to_markdown.rb +7 -5
- data/lib/rdoc/markup/verbatim.rb +1 -1
- data/lib/rdoc/method_attr.rb +13 -1
- data/lib/rdoc/mixin.rb +120 -0
- data/lib/rdoc/normal_class.rb +4 -0
- data/lib/rdoc/normal_module.rb +4 -0
- data/lib/rdoc/options.rb +42 -8
- data/lib/rdoc/parser.rb +4 -2
- data/lib/rdoc/parser/c.rb +13 -7
- data/lib/rdoc/parser/ruby.rb +683 -480
- data/lib/rdoc/rdoc.rb +4 -3
- data/lib/rdoc/ri/driver.rb +174 -103
- data/lib/rdoc/ri/paths.rb +6 -6
- data/lib/rdoc/ruby_lex.rb +125 -102
- data/lib/rdoc/ruby_token.rb +41 -40
- data/lib/rdoc/servlet.rb +16 -6
- data/lib/rdoc/stats.rb +61 -48
- data/lib/rdoc/store.rb +5 -3
- data/lib/rdoc/test_case.rb +39 -0
- data/lib/rdoc/tom_doc.rb +28 -4
- data/lib/rdoc/top_level.rb +2 -2
- data/test/test_rdoc_any_method.rb +104 -1
- data/test/test_rdoc_class_module.rb +9 -15
- data/test/test_rdoc_code_object.rb +133 -8
- data/test/test_rdoc_context.rb +17 -0
- data/test/test_rdoc_context_section.rb +0 -7
- data/test/test_rdoc_cross_reference.rb +4 -3
- data/test/test_rdoc_generator_darkfish.rb +61 -19
- data/test/test_rdoc_generator_json_index.rb +0 -11
- data/test/test_rdoc_generator_ri.rb +0 -8
- data/test/test_rdoc_markdown.rb +15 -12
- data/test/test_rdoc_markdown_test.rb +0 -7
- data/test/test_rdoc_markup_attribute_manager.rb +121 -0
- data/test/test_rdoc_markup_document.rb +0 -7
- data/test/test_rdoc_markup_formatter.rb +29 -3
- data/test/test_rdoc_markup_heading.rb +9 -0
- data/test/test_rdoc_markup_parser.rb +0 -7
- data/test/test_rdoc_markup_pre_process.rb +15 -3
- data/test/test_rdoc_markup_raw.rb +0 -7
- data/test/test_rdoc_markup_to_html.rb +50 -8
- data/test/test_rdoc_markup_to_html_crossref.rb +7 -0
- data/test/test_rdoc_markup_to_html_snippet.rb +4 -4
- data/test/test_rdoc_markup_to_markdown.rb +6 -0
- data/test/test_rdoc_method_attr.rb +8 -0
- data/test/test_rdoc_normal_class.rb +5 -0
- data/test/test_rdoc_normal_module.rb +5 -0
- data/test/test_rdoc_options.rb +61 -22
- data/test/test_rdoc_parser.rb +10 -0
- data/test/test_rdoc_parser_c.rb +17 -5
- data/test/test_rdoc_parser_changelog.rb +0 -7
- data/test/test_rdoc_parser_rd.rb +0 -7
- data/test/test_rdoc_parser_ruby.rb +305 -28
- data/test/test_rdoc_rd_block_parser.rb +0 -8
- data/test/test_rdoc_rd_inline_parser.rb +0 -1
- data/test/test_rdoc_rdoc.rb +27 -1
- data/test/test_rdoc_ri_driver.rb +19 -7
- data/test/test_rdoc_ruby_lex.rb +116 -9
- data/test/test_rdoc_rubygems_hook.rb +1 -1
- data/test/test_rdoc_servlet.rb +44 -6
- data/test/test_rdoc_stats.rb +161 -141
- data/test/test_rdoc_store.rb +11 -19
- data/test/test_rdoc_text.rb +0 -7
- data/test/test_rdoc_tom_doc.rb +44 -16
- data/test/xref_test_case.rb +2 -0
- metadata +28 -27
- metadata.gz.sig +0 -0
- data/test/test_attribute_manager.rb +0 -120
data/Rakefile
CHANGED
@@ -46,11 +46,13 @@ Depending on your version of ruby, you may need to install ruby rdoc/ri data:
|
|
46
46
|
self.history_file = 'History.rdoc'
|
47
47
|
self.testlib = :minitest
|
48
48
|
self.extra_rdoc_files += %w[
|
49
|
-
DEVELOPERS.rdoc
|
50
49
|
CVE-2013-0256.rdoc
|
50
|
+
CONTRIBUTING.rdoc
|
51
|
+
ExampleMarkdown.md
|
52
|
+
ExampleRDoc.rdoc
|
51
53
|
History.rdoc
|
52
|
-
LICENSE.rdoc
|
53
54
|
LEGAL.rdoc
|
55
|
+
LICENSE.rdoc
|
54
56
|
README.rdoc
|
55
57
|
RI.rdoc
|
56
58
|
TODO.rdoc
|
@@ -61,15 +63,43 @@ Depending on your version of ruby, you may need to install ruby rdoc/ri data:
|
|
61
63
|
|
62
64
|
require_ruby_version '>= 1.8.7'
|
63
65
|
extra_deps << ['json', '~> 1.4']
|
64
|
-
extra_dev_deps << ['racc', '~> 1.4']
|
66
|
+
extra_dev_deps << ['racc', '~> 1.4', '!= 1.4.10']
|
65
67
|
extra_dev_deps << ['minitest', '~> 4']
|
66
|
-
extra_dev_deps << ['ZenTest', '~> 4']
|
67
68
|
|
68
69
|
extra_rdoc_files << 'Rakefile'
|
69
70
|
spec_extras['required_rubygems_version'] = '>= 1.3'
|
70
71
|
spec_extras['homepage'] = 'http://docs.seattlerb.org/rdoc'
|
71
72
|
end
|
72
73
|
|
74
|
+
hoe.test_prelude = 'gem "minitest", "~> 4.0"'
|
75
|
+
|
76
|
+
def rake(*args)
|
77
|
+
sh $0, *args
|
78
|
+
end
|
79
|
+
|
80
|
+
if PARSER_FILES.any? {|file| not File.exist?(file)}
|
81
|
+
Rake::Task["default"].prerequisites.clear
|
82
|
+
task :default do
|
83
|
+
rake "install_plugins"
|
84
|
+
rake "newb"
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
Rake::Task['docs'].actions.clear
|
89
|
+
task :docs do
|
90
|
+
$LOAD_PATH.unshift 'lib'
|
91
|
+
require 'rdoc'
|
92
|
+
|
93
|
+
options = RDoc::Options.new
|
94
|
+
options.title = "rdoc #{RDoc::VERSION} Documentation"
|
95
|
+
options.op_dir = 'doc'
|
96
|
+
options.main_page = 'README.rdoc'
|
97
|
+
options.files = hoe.spec.extra_rdoc_files + %w[lib]
|
98
|
+
options.setup_generator 'darkfish'
|
99
|
+
|
100
|
+
RDoc::RDoc.new.document options
|
101
|
+
end
|
102
|
+
|
73
103
|
# requires ruby 1.8 and ruby 1.8 to build
|
74
104
|
hoe.clean_globs -= PARSER_FILES.grep(/literals_/)
|
75
105
|
|
data/lib/rdoc.rb
CHANGED
@@ -14,7 +14,7 @@ $DEBUG_RDOC = nil
|
|
14
14
|
#
|
15
15
|
# == Roadmap
|
16
16
|
#
|
17
|
-
# If you think you found a bug in RDoc see
|
17
|
+
# If you think you found a bug in RDoc see CONTRIBUTING@Bugs
|
18
18
|
#
|
19
19
|
# If you want to use RDoc to create documentation for your Ruby source files,
|
20
20
|
# see RDoc::Markup and refer to <tt>rdoc --help</tt> for command line usage.
|
@@ -42,7 +42,7 @@ $DEBUG_RDOC = nil
|
|
42
42
|
#
|
43
43
|
# If you want to write your own output generator see RDoc::Generator.
|
44
44
|
#
|
45
|
-
# If you want an overview of how RDoc works see
|
45
|
+
# If you want an overview of how RDoc works see CONTRIBUTING
|
46
46
|
#
|
47
47
|
# == Credits
|
48
48
|
#
|
@@ -64,7 +64,7 @@ module RDoc
|
|
64
64
|
##
|
65
65
|
# RDoc version you are using
|
66
66
|
|
67
|
-
VERSION = '4.0.
|
67
|
+
VERSION = '4.1.0.preview.3'
|
68
68
|
|
69
69
|
##
|
70
70
|
# Method visibilities
|
@@ -174,6 +174,7 @@ module RDoc
|
|
174
174
|
autoload :Attr, 'rdoc/attr'
|
175
175
|
|
176
176
|
autoload :Constant, 'rdoc/constant'
|
177
|
+
autoload :Mixin, 'rdoc/mixin'
|
177
178
|
autoload :Include, 'rdoc/include'
|
178
179
|
autoload :Extend, 'rdoc/extend'
|
179
180
|
autoload :Require, 'rdoc/require'
|
data/lib/rdoc/any_method.rb
CHANGED
@@ -9,8 +9,11 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
9
9
|
# Added calls_super
|
10
10
|
# Added parent name and class
|
11
11
|
# Added section title
|
12
|
+
# 3::
|
13
|
+
# RDoc 4.1
|
14
|
+
# Added is_alias_for
|
12
15
|
|
13
|
-
MARSHAL_VERSION =
|
16
|
+
MARSHAL_VERSION = 3 # :nodoc:
|
14
17
|
|
15
18
|
##
|
16
19
|
# Don't rename \#initialize to \::new
|
@@ -25,7 +28,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
25
28
|
##
|
26
29
|
# Different ways to call this method
|
27
30
|
|
28
|
-
|
31
|
+
attr_reader :call_seq
|
29
32
|
|
30
33
|
##
|
31
34
|
# Parameters for this method
|
@@ -89,6 +92,37 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
89
92
|
end
|
90
93
|
end
|
91
94
|
|
95
|
+
##
|
96
|
+
# Sets the different ways you can call this method. If an empty +call_seq+
|
97
|
+
# is given nil is assumed.
|
98
|
+
#
|
99
|
+
# See also #param_seq
|
100
|
+
|
101
|
+
def call_seq= call_seq
|
102
|
+
return if call_seq.empty?
|
103
|
+
|
104
|
+
@call_seq = call_seq
|
105
|
+
end
|
106
|
+
|
107
|
+
##
|
108
|
+
# Loads is_alias_for from the internal name. Returns nil if the alias
|
109
|
+
# cannot be found.
|
110
|
+
|
111
|
+
def is_alias_for # :nodoc:
|
112
|
+
case @is_alias_for
|
113
|
+
when RDoc::MethodAttr then
|
114
|
+
@is_alias_for
|
115
|
+
when Array then
|
116
|
+
return nil unless @store
|
117
|
+
|
118
|
+
klass_name, singleton, method_name = @is_alias_for
|
119
|
+
|
120
|
+
return nil unless klass = @store.find_class_or_module(klass_name)
|
121
|
+
|
122
|
+
@is_alias_for = klass.find_method method_name, singleton
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
92
126
|
##
|
93
127
|
# Dumps this AnyMethod for use by ri. See also #marshal_load
|
94
128
|
|
@@ -97,6 +131,12 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
97
131
|
[a.name, parse(a.comment)]
|
98
132
|
end
|
99
133
|
|
134
|
+
is_alias_for = [
|
135
|
+
@is_alias_for.parent.full_name,
|
136
|
+
@is_alias_for.singleton,
|
137
|
+
@is_alias_for.name
|
138
|
+
] if @is_alias_for
|
139
|
+
|
100
140
|
[ MARSHAL_VERSION,
|
101
141
|
@name,
|
102
142
|
full_name,
|
@@ -112,6 +152,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
112
152
|
@parent.name,
|
113
153
|
@parent.class,
|
114
154
|
@section.title,
|
155
|
+
is_alias_for,
|
115
156
|
]
|
116
157
|
end
|
117
158
|
|
@@ -126,7 +167,6 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
126
167
|
initialize_visibility
|
127
168
|
|
128
169
|
@dont_rename_initialize = nil
|
129
|
-
@is_alias_for = nil
|
130
170
|
@token_stream = nil
|
131
171
|
@aliases = []
|
132
172
|
@parent = nil
|
@@ -150,6 +190,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
150
190
|
@parent_name = array[12]
|
151
191
|
@parent_title = array[13]
|
152
192
|
@section_title = array[14]
|
193
|
+
@is_alias_for = array[15]
|
153
194
|
|
154
195
|
array[8].each do |new_name, comment|
|
155
196
|
add_alias RDoc::Alias.new(nil, @name, new_name, comment, @singleton)
|
@@ -174,7 +215,10 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
174
215
|
def name
|
175
216
|
return @name if @name
|
176
217
|
|
177
|
-
@name =
|
218
|
+
@name =
|
219
|
+
@call_seq[/^.*?\.(\w+)/, 1] ||
|
220
|
+
@call_seq[/^.*?(\w+)/, 1] ||
|
221
|
+
@call_seq if @call_seq
|
178
222
|
end
|
179
223
|
|
180
224
|
##
|
data/lib/rdoc/class_module.rb
CHANGED
@@ -169,13 +169,25 @@ class RDoc::ClassModule < RDoc::Context
|
|
169
169
|
includes.map { |i| i.module }.reverse
|
170
170
|
end
|
171
171
|
|
172
|
+
def aref_prefix # :nodoc:
|
173
|
+
raise NotImplementedError, "missing aref_prefix for #{self.class}"
|
174
|
+
end
|
175
|
+
|
176
|
+
##
|
177
|
+
# HTML fragment reference for this module or class. See
|
178
|
+
# RDoc::NormalClass#aref and RDoc::NormalModule#aref
|
179
|
+
|
180
|
+
def aref
|
181
|
+
"#{aref_prefix}-#{full_name}"
|
182
|
+
end
|
183
|
+
|
172
184
|
##
|
173
185
|
# Ancestors of this class or module only
|
174
186
|
|
175
187
|
alias direct_ancestors ancestors
|
176
188
|
|
177
189
|
##
|
178
|
-
# Clears the comment. Used by the
|
190
|
+
# Clears the comment. Used by the Ruby parser.
|
179
191
|
|
180
192
|
def clear_comment
|
181
193
|
@comment = ''
|
@@ -224,7 +236,9 @@ class RDoc::ClassModule < RDoc::Context
|
|
224
236
|
# #received_nodoc true?
|
225
237
|
|
226
238
|
def documented?
|
227
|
-
|
239
|
+
return true if @received_nodoc
|
240
|
+
return false if @comment_location.empty?
|
241
|
+
@comment_location.any? { |comment, _| not comment.empty? }
|
228
242
|
end
|
229
243
|
|
230
244
|
##
|
data/lib/rdoc/code_object.rb
CHANGED
@@ -20,8 +20,9 @@
|
|
20
20
|
# * RDoc::MetaMethod
|
21
21
|
# * RDoc::Alias
|
22
22
|
# * RDoc::Constant
|
23
|
-
# * RDoc::
|
24
|
-
#
|
23
|
+
# * RDoc::Mixin
|
24
|
+
# * RDoc::Require
|
25
|
+
# * RDoc::Include
|
25
26
|
|
26
27
|
class RDoc::CodeObject
|
27
28
|
|
@@ -92,7 +93,7 @@ class RDoc::CodeObject
|
|
92
93
|
##
|
93
94
|
# The RDoc::Store for this object.
|
94
95
|
|
95
|
-
|
96
|
+
attr_reader :store
|
96
97
|
|
97
98
|
##
|
98
99
|
# We are the model of the code, but we know that at some point we will be
|
@@ -105,16 +106,17 @@ class RDoc::CodeObject
|
|
105
106
|
# Creates a new CodeObject that will document itself and its children
|
106
107
|
|
107
108
|
def initialize
|
108
|
-
@metadata
|
109
|
-
@comment
|
110
|
-
@parent
|
111
|
-
@parent_name
|
112
|
-
@parent_class
|
113
|
-
@section
|
114
|
-
@section_title
|
115
|
-
@file
|
116
|
-
@full_name
|
117
|
-
@store
|
109
|
+
@metadata = {}
|
110
|
+
@comment = ''
|
111
|
+
@parent = nil
|
112
|
+
@parent_name = nil # for loading
|
113
|
+
@parent_class = nil # for loading
|
114
|
+
@section = nil
|
115
|
+
@section_title = nil # for loading
|
116
|
+
@file = nil
|
117
|
+
@full_name = nil
|
118
|
+
@store = nil
|
119
|
+
@track_visibility = true
|
118
120
|
|
119
121
|
initialize_visibility
|
120
122
|
end
|
@@ -129,6 +131,8 @@ class RDoc::CodeObject
|
|
129
131
|
@force_documentation = false
|
130
132
|
@received_nodoc = false
|
131
133
|
@ignored = false
|
134
|
+
@suppressed = false
|
135
|
+
@track_visibility = true
|
132
136
|
end
|
133
137
|
|
134
138
|
##
|
@@ -155,10 +159,17 @@ class RDoc::CodeObject
|
|
155
159
|
end
|
156
160
|
|
157
161
|
##
|
158
|
-
# Should this CodeObject be
|
162
|
+
# Should this CodeObject be displayed in output?
|
163
|
+
#
|
164
|
+
# A code object should be displayed if:
|
165
|
+
#
|
166
|
+
# * The item didn't have a nodoc or wasn't in a container that had nodoc
|
167
|
+
# * The item wasn't ignored
|
168
|
+
# * The item has documentation and was not suppressed
|
159
169
|
|
160
170
|
def display?
|
161
|
-
@document_self and not @ignored
|
171
|
+
@document_self and not @ignored and
|
172
|
+
(documented? or not @suppressed)
|
162
173
|
end
|
163
174
|
|
164
175
|
##
|
@@ -166,6 +177,8 @@ class RDoc::CodeObject
|
|
166
177
|
# has been turned off by :enddoc:
|
167
178
|
|
168
179
|
def document_children=(document_children)
|
180
|
+
return unless @track_visibility
|
181
|
+
|
169
182
|
@document_children = document_children unless @done_documenting
|
170
183
|
end
|
171
184
|
|
@@ -175,6 +188,7 @@ class RDoc::CodeObject
|
|
175
188
|
# documentation is turned off by +:nodoc:+.
|
176
189
|
|
177
190
|
def document_self=(document_self)
|
191
|
+
return unless @track_visibility
|
178
192
|
return if @done_documenting
|
179
193
|
|
180
194
|
@document_self = document_self
|
@@ -198,8 +212,9 @@ class RDoc::CodeObject
|
|
198
212
|
# will have no effect in the current file.
|
199
213
|
|
200
214
|
def done_documenting=(value)
|
201
|
-
|
202
|
-
@
|
215
|
+
return unless @track_visibility
|
216
|
+
@done_documenting = value
|
217
|
+
@document_self = !value
|
203
218
|
@document_children = @document_self
|
204
219
|
end
|
205
220
|
|
@@ -249,7 +264,7 @@ class RDoc::CodeObject
|
|
249
264
|
|
250
265
|
##
|
251
266
|
# Use this to ignore a CodeObject and all its children until found again
|
252
|
-
# (#record_location is called). An ignored item will not be
|
267
|
+
# (#record_location is called). An ignored item will not be displayed in
|
253
268
|
# documentation.
|
254
269
|
#
|
255
270
|
# See github issue #55
|
@@ -259,10 +274,13 @@ class RDoc::CodeObject
|
|
259
274
|
# and modules to add new documentation to previously created classes.
|
260
275
|
#
|
261
276
|
# If a class was ignored (via stopdoc) then reopened later with additional
|
262
|
-
# documentation it should be
|
263
|
-
# reopened it should not be
|
277
|
+
# documentation it should be displayed. If a class was ignored and never
|
278
|
+
# reopened it should not be displayed. The ignore flag allows this to
|
279
|
+
# occur.
|
264
280
|
|
265
281
|
def ignore
|
282
|
+
return unless @track_visibility
|
283
|
+
|
266
284
|
@ignored = true
|
267
285
|
|
268
286
|
stop_doc
|
@@ -270,6 +288,8 @@ class RDoc::CodeObject
|
|
270
288
|
|
271
289
|
##
|
272
290
|
# Has this class been ignored?
|
291
|
+
#
|
292
|
+
# See also #ignore
|
273
293
|
|
274
294
|
def ignored?
|
275
295
|
@ignored
|
@@ -282,7 +302,7 @@ class RDoc::CodeObject
|
|
282
302
|
# This is used by Text#snippet
|
283
303
|
|
284
304
|
def options
|
285
|
-
if @store then
|
305
|
+
if @store and @store.rdoc then
|
286
306
|
@store.rdoc.options
|
287
307
|
else
|
288
308
|
RDoc::Options.new
|
@@ -330,8 +350,9 @@ class RDoc::CodeObject
|
|
330
350
|
# Records the RDoc::TopLevel (file) where this code object was defined
|
331
351
|
|
332
352
|
def record_location top_level
|
333
|
-
@ignored
|
334
|
-
@
|
353
|
+
@ignored = false
|
354
|
+
@suppressed = false
|
355
|
+
@file = top_level
|
335
356
|
end
|
336
357
|
|
337
358
|
##
|
@@ -353,16 +374,56 @@ class RDoc::CodeObject
|
|
353
374
|
|
354
375
|
@document_self = true
|
355
376
|
@document_children = true
|
356
|
-
@ignored
|
377
|
+
@ignored = false
|
378
|
+
@suppressed = false
|
357
379
|
end
|
358
380
|
|
359
381
|
##
|
360
382
|
# Disable capture of documentation
|
361
383
|
|
362
384
|
def stop_doc
|
385
|
+
return unless @track_visibility
|
386
|
+
|
363
387
|
@document_self = false
|
364
388
|
@document_children = false
|
365
389
|
end
|
366
390
|
|
391
|
+
##
|
392
|
+
# Sets the +store+ that contains this CodeObject
|
393
|
+
|
394
|
+
def store= store
|
395
|
+
@store = store
|
396
|
+
|
397
|
+
return unless @track_visibility
|
398
|
+
|
399
|
+
if :nodoc == options.visibility then
|
400
|
+
initialize_visibility
|
401
|
+
@track_visibility = false
|
402
|
+
end
|
403
|
+
end
|
404
|
+
|
405
|
+
##
|
406
|
+
# Use this to suppress a CodeObject and all its children until the next file
|
407
|
+
# it is seen in or documentation is discovered. A suppressed item with
|
408
|
+
# documentation will be displayed while an ignored item with documentation
|
409
|
+
# may not be displayed.
|
410
|
+
|
411
|
+
def suppress
|
412
|
+
return unless @track_visibility
|
413
|
+
|
414
|
+
@suppressed = true
|
415
|
+
|
416
|
+
stop_doc
|
417
|
+
end
|
418
|
+
|
419
|
+
##
|
420
|
+
# Has this class been suppressed?
|
421
|
+
#
|
422
|
+
# See also #suppress
|
423
|
+
|
424
|
+
def suppressed?
|
425
|
+
@suppressed
|
426
|
+
end
|
427
|
+
|
367
428
|
end
|
368
429
|
|