rdoc 6.13.1 → 6.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.rdoc +3 -1
- data/lib/rdoc/code_object/any_method.rb +4 -4
- data/lib/rdoc/code_object/attr.rb +3 -3
- data/lib/rdoc/code_object/class_module.rb +15 -15
- data/lib/rdoc/code_object/constant.rb +5 -5
- data/lib/rdoc/code_object/context/section.rb +8 -7
- data/lib/rdoc/code_object/context.rb +19 -19
- data/lib/rdoc/code_object/method_attr.rb +7 -6
- data/lib/rdoc/code_object/mixin.rb +3 -3
- data/lib/rdoc/code_object/normal_class.rb +1 -1
- data/lib/rdoc/code_object/normal_module.rb +1 -1
- data/lib/rdoc/code_object/single_class.rb +1 -1
- data/lib/rdoc/code_object/top_level.rb +7 -7
- data/lib/rdoc/code_object.rb +3 -3
- data/lib/rdoc/comment.rb +6 -6
- data/lib/rdoc/cross_reference.rb +3 -3
- data/lib/rdoc/encoding.rb +4 -4
- data/lib/rdoc/erb_partial.rb +1 -1
- data/lib/rdoc/erbio.rb +2 -2
- data/lib/rdoc/generator/darkfish.rb +15 -15
- data/lib/rdoc/generator/json_index.rb +3 -3
- data/lib/rdoc/generator/markup.rb +12 -0
- data/lib/rdoc/generator/pot/message_extractor.rb +4 -4
- data/lib/rdoc/generator/pot/po.rb +1 -1
- data/lib/rdoc/generator/pot/po_entry.rb +7 -7
- data/lib/rdoc/generator/pot.rb +1 -1
- data/lib/rdoc/generator/ri.rb +1 -1
- data/lib/rdoc/generator/template/darkfish/_head.rhtml +5 -0
- data/lib/rdoc/generator/template/darkfish/css/rdoc.css +2 -0
- data/lib/rdoc/markup/attribute_manager.rb +5 -5
- data/lib/rdoc/markup/attributes.rb +3 -3
- data/lib/rdoc/markup/blank_line.rb +2 -2
- data/lib/rdoc/markup/block_quote.rb +1 -1
- data/lib/rdoc/markup/document.rb +8 -8
- data/lib/rdoc/markup/formatter.rb +12 -12
- data/lib/rdoc/markup/hard_break.rb +3 -3
- data/lib/rdoc/markup/heading.rb +4 -4
- data/lib/rdoc/markup/include.rb +3 -3
- data/lib/rdoc/markup/indented_paragraph.rb +3 -3
- data/lib/rdoc/markup/list.rb +4 -4
- data/lib/rdoc/markup/list_item.rb +4 -4
- data/lib/rdoc/markup/paragraph.rb +2 -2
- data/lib/rdoc/markup/parser.rb +11 -11
- data/lib/rdoc/markup/pre_process.rb +6 -6
- data/lib/rdoc/markup/raw.rb +5 -5
- data/lib/rdoc/markup/rule.rb +2 -2
- data/lib/rdoc/markup/table.rb +4 -4
- data/lib/rdoc/markup/to_ansi.rb +3 -3
- data/lib/rdoc/markup/to_bs.rb +6 -6
- data/lib/rdoc/markup/to_html.rb +20 -16
- data/lib/rdoc/markup/to_html_crossref.rb +5 -5
- data/lib/rdoc/markup/to_html_snippet.rb +17 -17
- data/lib/rdoc/markup/to_joined_paragraph.rb +1 -1
- data/lib/rdoc/markup/to_label.rb +6 -5
- data/lib/rdoc/markup/to_markdown.rb +12 -12
- data/lib/rdoc/markup/to_rdoc.rb +29 -28
- data/lib/rdoc/markup/to_table_of_contents.rb +3 -3
- data/lib/rdoc/markup/to_test.rb +1 -1
- data/lib/rdoc/markup/to_tt_only.rb +8 -8
- data/lib/rdoc/markup/verbatim.rb +3 -3
- data/lib/rdoc/markup.rb +3 -3
- data/lib/rdoc/options.rb +19 -12
- data/lib/rdoc/parser/c.rb +16 -16
- data/lib/rdoc/parser/changelog.rb +9 -9
- data/lib/rdoc/parser/prism_ruby.rb +1 -1
- data/lib/rdoc/parser/ruby.rb +43 -43
- data/lib/rdoc/parser/simple.rb +2 -2
- data/lib/rdoc/parser.rb +8 -8
- data/lib/rdoc/rd/inline.rb +4 -4
- data/lib/rdoc/rd.rb +1 -1
- data/lib/rdoc/rdoc.rb +8 -8
- data/lib/rdoc/ri/driver.rb +49 -49
- data/lib/rdoc/ri/paths.rb +2 -2
- data/lib/rdoc/ri/task.rb +1 -1
- data/lib/rdoc/rubygems_hook.rb +14 -11
- data/lib/rdoc/servlet.rb +15 -15
- data/lib/rdoc/stats/normal.rb +1 -1
- data/lib/rdoc/stats/quiet.rb +1 -1
- data/lib/rdoc/stats/verbose.rb +3 -3
- data/lib/rdoc/stats.rb +12 -12
- data/lib/rdoc/store.rb +30 -30
- data/lib/rdoc/task.rb +2 -2
- data/lib/rdoc/text.rb +11 -11
- data/lib/rdoc/token_stream.rb +1 -1
- data/lib/rdoc/tom_doc.rb +7 -7
- data/lib/rdoc/version.rb +1 -1
- data/man/ri.1 +2 -0
- data/rdoc.gemspec +69 -0
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a7e93ac9c35220aeef63714f07b7ad32fc23de76e17e92e32a49012e32f304e
|
4
|
+
data.tar.gz: f273ce6acb9a2caf5e663ddfaae80d676a07e2b0e2d7de818218da742ed795d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5deecbe6a6a8562324936b2c458c45be5565832ec9ff2ac2fb79f6c2dd8d72add9e08c24485eaa7365d5d0628abed02d0d6a198067d64f0217a6789633c7e57e
|
7
|
+
data.tar.gz: 1ca6dad24e4f748fa8863e301c5f87a89b174523eaf62f2ab505845b2f15aaa4e6a7b215c7ff325c198052358ebfd9c206f0b743c2f97da0eff7444c0edacf96
|
data/README.rdoc
CHANGED
@@ -54,6 +54,8 @@ To generate documentation programmatically:
|
|
54
54
|
require 'rdoc/rdoc'
|
55
55
|
|
56
56
|
options = RDoc::Options.new
|
57
|
+
options.files = ['a.rb', 'b.rb']
|
58
|
+
options.setup_generator 'darkfish'
|
57
59
|
# see RDoc::Options
|
58
60
|
|
59
61
|
rdoc = RDoc::RDoc.new
|
@@ -121,7 +123,7 @@ Please follow the theme's README for usage instructions.
|
|
121
123
|
|
122
124
|
== Bugs
|
123
125
|
|
124
|
-
See CONTRIBUTING
|
126
|
+
See CONTRIBUTING.rdoc for information on filing a bug report. It's OK to file
|
125
127
|
a bug report for anything you're having a problem with. If you can't figure
|
126
128
|
out how to make RDoc produce the output you like that is probably a
|
127
129
|
documentation bug.
|
@@ -52,7 +52,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
52
52
|
##
|
53
53
|
# Adds +an_alias+ as an alias for this method in +context+.
|
54
54
|
|
55
|
-
def add_alias
|
55
|
+
def add_alias(an_alias, context = nil)
|
56
56
|
method = self.class.new an_alias.text, an_alias.new_name, singleton: singleton
|
57
57
|
|
58
58
|
method.record_location an_alias.file
|
@@ -104,7 +104,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
104
104
|
#
|
105
105
|
# See also #param_seq
|
106
106
|
|
107
|
-
def call_seq=
|
107
|
+
def call_seq=(call_seq)
|
108
108
|
return if call_seq.nil? || call_seq.empty?
|
109
109
|
|
110
110
|
@call_seq = call_seq
|
@@ -176,7 +176,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
176
176
|
# * #full_name
|
177
177
|
# * #parent_name
|
178
178
|
|
179
|
-
def marshal_load
|
179
|
+
def marshal_load(array)
|
180
180
|
initialize_visibility
|
181
181
|
|
182
182
|
@dont_rename_initialize = nil
|
@@ -309,7 +309,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
309
309
|
##
|
310
310
|
# Sets the store for this method and its referenced code objects.
|
311
311
|
|
312
|
-
def store=
|
312
|
+
def store=(store)
|
313
313
|
super
|
314
314
|
|
315
315
|
@file = @store.add_file @file.full_name if @file
|
@@ -32,7 +32,7 @@ class RDoc::Attr < RDoc::MethodAttr
|
|
32
32
|
##
|
33
33
|
# Attributes are equal when their names, singleton and rw are identical
|
34
34
|
|
35
|
-
def ==
|
35
|
+
def ==(other)
|
36
36
|
self.class == other.class and
|
37
37
|
self.name == other.name and
|
38
38
|
self.rw == other.rw and
|
@@ -118,7 +118,7 @@ class RDoc::Attr < RDoc::MethodAttr
|
|
118
118
|
# * #full_name
|
119
119
|
# * #parent_name
|
120
120
|
|
121
|
-
def marshal_load
|
121
|
+
def marshal_load(array)
|
122
122
|
initialize_visibility
|
123
123
|
|
124
124
|
@aliases = []
|
@@ -145,7 +145,7 @@ class RDoc::Attr < RDoc::MethodAttr
|
|
145
145
|
@parent_name ||= @full_name.split('#', 2).first
|
146
146
|
end
|
147
147
|
|
148
|
-
def pretty_print
|
148
|
+
def pretty_print(q) # :nodoc:
|
149
149
|
q.group 2, "[#{self.class.name} #{full_name} #{rw} #{visibility}", "]" do
|
150
150
|
unless comment.empty? then
|
151
151
|
q.breakable
|
@@ -45,7 +45,7 @@ class RDoc::ClassModule < RDoc::Context
|
|
45
45
|
#--
|
46
46
|
# TODO move to RDoc::NormalClass (I think)
|
47
47
|
|
48
|
-
def self.from_module
|
48
|
+
def self.from_module(class_type, mod)
|
49
49
|
klass = class_type.new mod.name
|
50
50
|
|
51
51
|
mod.comment_location.each do |comment, location|
|
@@ -120,7 +120,7 @@ class RDoc::ClassModule < RDoc::Context
|
|
120
120
|
# method is preferred over #comment= since it allows ri data to be updated
|
121
121
|
# across multiple runs.
|
122
122
|
|
123
|
-
def add_comment
|
123
|
+
def add_comment(comment, location)
|
124
124
|
return unless document_self
|
125
125
|
|
126
126
|
original = comment
|
@@ -141,7 +141,7 @@ class RDoc::ClassModule < RDoc::Context
|
|
141
141
|
self.comment = original
|
142
142
|
end
|
143
143
|
|
144
|
-
def add_things
|
144
|
+
def add_things(my_things, other_things) # :nodoc:
|
145
145
|
other_things.each do |group, things|
|
146
146
|
my_things[group].each { |thing| yield false, thing } if
|
147
147
|
my_things.include? group
|
@@ -198,7 +198,7 @@ class RDoc::ClassModule < RDoc::Context
|
|
198
198
|
# Appends +comment+ to the current comment, but separated by a rule. Works
|
199
199
|
# more like <tt>+=</tt>.
|
200
200
|
|
201
|
-
def comment=
|
201
|
+
def comment=(comment) # :nodoc:
|
202
202
|
comment = case comment
|
203
203
|
when RDoc::Comment then
|
204
204
|
comment.normalize
|
@@ -216,7 +216,7 @@ class RDoc::ClassModule < RDoc::Context
|
|
216
216
|
#
|
217
217
|
# See RDoc::Store#complete
|
218
218
|
|
219
|
-
def complete
|
219
|
+
def complete(min_visibility)
|
220
220
|
update_aliases
|
221
221
|
remove_nodoc_children
|
222
222
|
embed_mixins
|
@@ -259,7 +259,7 @@ class RDoc::ClassModule < RDoc::Context
|
|
259
259
|
##
|
260
260
|
# Looks for a symbol in the #ancestors. See Context#find_local_symbol.
|
261
261
|
|
262
|
-
def find_ancestor_local_symbol
|
262
|
+
def find_ancestor_local_symbol(symbol)
|
263
263
|
each_ancestor do |m|
|
264
264
|
res = m.find_local_symbol(symbol)
|
265
265
|
return res if res
|
@@ -271,7 +271,7 @@ class RDoc::ClassModule < RDoc::Context
|
|
271
271
|
##
|
272
272
|
# Finds a class or module with +name+ in this namespace or its descendants
|
273
273
|
|
274
|
-
def find_class_named
|
274
|
+
def find_class_named(name)
|
275
275
|
return self if full_name == name
|
276
276
|
return self if @name == name
|
277
277
|
|
@@ -360,7 +360,7 @@ class RDoc::ClassModule < RDoc::Context
|
|
360
360
|
]
|
361
361
|
end
|
362
362
|
|
363
|
-
def marshal_load
|
363
|
+
def marshal_load(array) # :nodoc:
|
364
364
|
initialize_visibility
|
365
365
|
initialize_methods_etc
|
366
366
|
@current_section = nil
|
@@ -450,7 +450,7 @@ class RDoc::ClassModule < RDoc::Context
|
|
450
450
|
#
|
451
451
|
# The data in +class_module+ is preferred over the receiver.
|
452
452
|
|
453
|
-
def merge
|
453
|
+
def merge(class_module)
|
454
454
|
@parent = class_module.parent
|
455
455
|
@parent_name = class_module.parent_name
|
456
456
|
|
@@ -535,7 +535,7 @@ class RDoc::ClassModule < RDoc::Context
|
|
535
535
|
# end
|
536
536
|
# end
|
537
537
|
|
538
|
-
def merge_collections
|
538
|
+
def merge_collections(mine, other, other_files, &block) # :nodoc:
|
539
539
|
my_things = mine. group_by { |thing| thing.file }
|
540
540
|
other_things = other.group_by { |thing| thing.file }
|
541
541
|
|
@@ -547,7 +547,7 @@ class RDoc::ClassModule < RDoc::Context
|
|
547
547
|
# Merges the comments in this ClassModule with the comments in the other
|
548
548
|
# ClassModule +cm+.
|
549
549
|
|
550
|
-
def merge_sections
|
550
|
+
def merge_sections(cm) # :nodoc:
|
551
551
|
my_sections = sections.group_by { |section| section.title }
|
552
552
|
other_sections = cm.sections.group_by { |section| section.title }
|
553
553
|
|
@@ -595,7 +595,7 @@ class RDoc::ClassModule < RDoc::Context
|
|
595
595
|
#
|
596
596
|
# Used for modules and classes that are constant aliases.
|
597
597
|
|
598
|
-
def name=
|
598
|
+
def name=(new_name)
|
599
599
|
@name = new_name
|
600
600
|
end
|
601
601
|
|
@@ -603,7 +603,7 @@ class RDoc::ClassModule < RDoc::Context
|
|
603
603
|
# Parses +comment_location+ into an RDoc::Markup::Document composed of
|
604
604
|
# multiple RDoc::Markup::Documents with their file set.
|
605
605
|
|
606
|
-
def parse
|
606
|
+
def parse(comment_location)
|
607
607
|
case comment_location
|
608
608
|
when String then
|
609
609
|
super
|
@@ -675,7 +675,7 @@ class RDoc::ClassModule < RDoc::Context
|
|
675
675
|
end
|
676
676
|
end
|
677
677
|
|
678
|
-
def remove_things
|
678
|
+
def remove_things(my_things, other_files) # :nodoc:
|
679
679
|
my_things.delete_if do |file, things|
|
680
680
|
next false unless other_files.include? file
|
681
681
|
|
@@ -705,7 +705,7 @@ class RDoc::ClassModule < RDoc::Context
|
|
705
705
|
##
|
706
706
|
# Sets the store for this class or module and its contained code objects.
|
707
707
|
|
708
|
-
def store=
|
708
|
+
def store=(store)
|
709
709
|
super
|
710
710
|
|
711
711
|
@attributes .each do |attr| attr.store = store end
|
@@ -44,7 +44,7 @@ class RDoc::Constant < RDoc::CodeObject
|
|
44
44
|
##
|
45
45
|
# Constants are ordered by name
|
46
46
|
|
47
|
-
def <=>
|
47
|
+
def <=>(other)
|
48
48
|
return unless self.class === other
|
49
49
|
|
50
50
|
[parent_name, name] <=> [other.parent_name, other.name]
|
@@ -53,7 +53,7 @@ class RDoc::Constant < RDoc::CodeObject
|
|
53
53
|
##
|
54
54
|
# Constants are equal when their #parent and #name is the same
|
55
55
|
|
56
|
-
def ==
|
56
|
+
def ==(other)
|
57
57
|
self.class == other.class and
|
58
58
|
@parent == other.parent and
|
59
59
|
@name == other.name
|
@@ -132,7 +132,7 @@ class RDoc::Constant < RDoc::CodeObject
|
|
132
132
|
# * #full_name
|
133
133
|
# * #parent_name
|
134
134
|
|
135
|
-
def marshal_load
|
135
|
+
def marshal_load(array)
|
136
136
|
initialize array[1], nil, RDoc::Comment.from_document(array[5])
|
137
137
|
|
138
138
|
@full_name = array[2]
|
@@ -154,7 +154,7 @@ class RDoc::Constant < RDoc::CodeObject
|
|
154
154
|
"#{@parent.path}##{@name}"
|
155
155
|
end
|
156
156
|
|
157
|
-
def pretty_print
|
157
|
+
def pretty_print(q) # :nodoc:
|
158
158
|
q.group 2, "[#{self.class.name} #{full_name}", "]" do
|
159
159
|
unless comment.empty? then
|
160
160
|
q.breakable
|
@@ -168,7 +168,7 @@ class RDoc::Constant < RDoc::CodeObject
|
|
168
168
|
##
|
169
169
|
# Sets the store for this class or module and its contained code objects.
|
170
170
|
|
171
|
-
def store=
|
171
|
+
def store=(store)
|
172
172
|
super
|
173
173
|
|
174
174
|
@file = @store.add_file @file.full_name if @file
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'cgi/
|
2
|
+
require 'cgi/escape'
|
3
|
+
require 'cgi/util' unless defined?(CGI::EscapeExt)
|
3
4
|
|
4
5
|
##
|
5
6
|
# A section of documentation like:
|
@@ -39,7 +40,7 @@ class RDoc::Context::Section
|
|
39
40
|
##
|
40
41
|
# Creates a new section with +title+ and +comment+
|
41
42
|
|
42
|
-
def initialize
|
43
|
+
def initialize(parent, title, comment)
|
43
44
|
@parent = parent
|
44
45
|
@title = title ? title.strip : title
|
45
46
|
|
@@ -51,7 +52,7 @@ class RDoc::Context::Section
|
|
51
52
|
##
|
52
53
|
# Sections are equal when they have the same #title
|
53
54
|
|
54
|
-
def ==
|
55
|
+
def ==(other)
|
55
56
|
self.class === other and @title == other.title
|
56
57
|
end
|
57
58
|
|
@@ -60,7 +61,7 @@ class RDoc::Context::Section
|
|
60
61
|
##
|
61
62
|
# Adds +comment+ to this section
|
62
63
|
|
63
|
-
def add_comment
|
64
|
+
def add_comment(comment)
|
64
65
|
comments = Array(comment)
|
65
66
|
comments.each do |c|
|
66
67
|
extracted_comment = extract_comment(c)
|
@@ -86,7 +87,7 @@ class RDoc::Context::Section
|
|
86
87
|
# # :section: The title
|
87
88
|
# # The body
|
88
89
|
|
89
|
-
def extract_comment
|
90
|
+
def extract_comment(comment)
|
90
91
|
case comment
|
91
92
|
when nil
|
92
93
|
RDoc::Comment.new ''
|
@@ -138,7 +139,7 @@ class RDoc::Context::Section
|
|
138
139
|
##
|
139
140
|
# De-serializes this Section. The section parent must be restored manually.
|
140
141
|
|
141
|
-
def marshal_load
|
142
|
+
def marshal_load(array)
|
142
143
|
@parent = nil
|
143
144
|
|
144
145
|
@title = array[1]
|
@@ -166,7 +167,7 @@ class RDoc::Context::Section
|
|
166
167
|
# Removes a comment from this section if it is from the same file as
|
167
168
|
# +comment+
|
168
169
|
|
169
|
-
def remove_comment
|
170
|
+
def remove_comment(target_comment)
|
170
171
|
@comments.delete_if do |stored_comment|
|
171
172
|
stored_comment.file == target_comment.file
|
172
173
|
end
|
@@ -180,7 +180,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
180
180
|
#
|
181
181
|
# Currently only RDoc::Extend and RDoc::Include are supported.
|
182
182
|
|
183
|
-
def add
|
183
|
+
def add(klass, name, comment)
|
184
184
|
if RDoc::Extend == klass then
|
185
185
|
ext = RDoc::Extend.new name, comment
|
186
186
|
add_extend ext
|
@@ -195,7 +195,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
195
195
|
##
|
196
196
|
# Adds +an_alias+ that is automatically resolved
|
197
197
|
|
198
|
-
def add_alias
|
198
|
+
def add_alias(an_alias)
|
199
199
|
return an_alias unless @document_self
|
200
200
|
|
201
201
|
method_attr = find_method(an_alias.old_name, an_alias.singleton) ||
|
@@ -222,7 +222,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
222
222
|
# if method +foo+ exists, but <tt>attr_accessor :foo</tt> will be registered
|
223
223
|
# if method +foo+ exists, but <tt>foo=</tt> does not.
|
224
224
|
|
225
|
-
def add_attribute
|
225
|
+
def add_attribute(attribute)
|
226
226
|
return attribute unless @document_self
|
227
227
|
|
228
228
|
# mainly to check for redefinition of an attribute as a method
|
@@ -285,7 +285,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
285
285
|
# unless it later sees <tt>class Container</tt>. +add_class+ automatically
|
286
286
|
# upgrades +given_name+ to a class in this case.
|
287
287
|
|
288
|
-
def add_class
|
288
|
+
def add_class(class_type, given_name, superclass = '::Object')
|
289
289
|
# superclass +nil+ is passed by the C parser in the following cases:
|
290
290
|
# - registering Object in 1.8 (correct)
|
291
291
|
# - registering BasicObject in 1.9 (correct)
|
@@ -401,7 +401,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
401
401
|
# unless #done_documenting is +true+. Sets the #parent of +mod+
|
402
402
|
# to +self+, and its #section to #current_section. Returns +mod+.
|
403
403
|
|
404
|
-
def add_class_or_module
|
404
|
+
def add_class_or_module(mod, self_hash, all_hash)
|
405
405
|
mod.section = current_section # TODO declaring context? something is
|
406
406
|
# wrong here...
|
407
407
|
mod.parent = self
|
@@ -426,7 +426,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
426
426
|
# Adds +constant+ if not already there. If it is, updates the comment,
|
427
427
|
# value and/or is_alias_for of the known constant if they were empty/nil.
|
428
428
|
|
429
|
-
def add_constant
|
429
|
+
def add_constant(constant)
|
430
430
|
return constant unless @document_self
|
431
431
|
|
432
432
|
# HACK: avoid duplicate 'PI' & 'E' in math.c (1.8.7 source code)
|
@@ -451,7 +451,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
451
451
|
##
|
452
452
|
# Adds included module +include+ which should be an RDoc::Include
|
453
453
|
|
454
|
-
def add_include
|
454
|
+
def add_include(include)
|
455
455
|
add_to @includes, include
|
456
456
|
|
457
457
|
include
|
@@ -460,7 +460,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
460
460
|
##
|
461
461
|
# Adds extension module +ext+ which should be an RDoc::Extend
|
462
462
|
|
463
|
-
def add_extend
|
463
|
+
def add_extend(ext)
|
464
464
|
add_to @extends, ext
|
465
465
|
|
466
466
|
ext
|
@@ -470,7 +470,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
470
470
|
# Adds +method+ if not already there. If it is (as method or attribute),
|
471
471
|
# updates the comment if it was empty.
|
472
472
|
|
473
|
-
def add_method
|
473
|
+
def add_method(method)
|
474
474
|
return method unless @document_self
|
475
475
|
|
476
476
|
# HACK: avoid duplicate 'new' in io.c & struct.c (1.8.7 source code)
|
@@ -524,7 +524,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
524
524
|
# Adds an alias from +from+ (a class or module) to +name+ which was defined
|
525
525
|
# in +file+.
|
526
526
|
|
527
|
-
def add_module_alias
|
527
|
+
def add_module_alias(from, from_name, to, file)
|
528
528
|
return from if @done_documenting
|
529
529
|
|
530
530
|
to_full_name = child_name to.name
|
@@ -583,7 +583,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
583
583
|
#
|
584
584
|
# See also RDoc::Context::Section
|
585
585
|
|
586
|
-
def add_section
|
586
|
+
def add_section(title, comment = nil)
|
587
587
|
if section = @sections[title] then
|
588
588
|
section.add_comment comment if comment
|
589
589
|
else
|
@@ -597,7 +597,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
597
597
|
##
|
598
598
|
# Adds +thing+ to the collection +array+
|
599
599
|
|
600
|
-
def add_to
|
600
|
+
def add_to(array, thing)
|
601
601
|
array << thing if @document_self
|
602
602
|
|
603
603
|
thing.parent = self
|
@@ -629,7 +629,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
629
629
|
##
|
630
630
|
# Creates the full name for a child with +name+
|
631
631
|
|
632
|
-
def child_name
|
632
|
+
def child_name(name)
|
633
633
|
if name =~ /^:+/
|
634
634
|
$' #'
|
635
635
|
elsif RDoc::TopLevel === self then
|
@@ -970,7 +970,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
970
970
|
# If +section+ is provided only methods in that RDoc::Context::Section will
|
971
971
|
# be returned.
|
972
972
|
|
973
|
-
def methods_by_type
|
973
|
+
def methods_by_type(section = nil)
|
974
974
|
methods = {}
|
975
975
|
|
976
976
|
TYPES.each do |type|
|
@@ -1062,7 +1062,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
1062
1062
|
#--
|
1063
1063
|
# TODO mark the visibility of attributes in the template (if not public?)
|
1064
1064
|
|
1065
|
-
def remove_invisible
|
1065
|
+
def remove_invisible(min_visibility)
|
1066
1066
|
return if [:private, :nodoc].include? min_visibility
|
1067
1067
|
remove_invisible_in @method_list, min_visibility
|
1068
1068
|
remove_invisible_in @attributes, min_visibility
|
@@ -1072,7 +1072,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
1072
1072
|
##
|
1073
1073
|
# Only called when min_visibility == :public or :private
|
1074
1074
|
|
1075
|
-
def remove_invisible_in
|
1075
|
+
def remove_invisible_in(array, min_visibility) # :nodoc:
|
1076
1076
|
if min_visibility == :public then
|
1077
1077
|
array.reject! { |e|
|
1078
1078
|
e.visibility != :public and not e.force_documentation
|
@@ -1088,7 +1088,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
1088
1088
|
# Tries to resolve unmatched aliases when a method or attribute has just
|
1089
1089
|
# been added.
|
1090
1090
|
|
1091
|
-
def resolve_aliases
|
1091
|
+
def resolve_aliases(added)
|
1092
1092
|
# resolve any pending unmatched aliases
|
1093
1093
|
key = added.pretty_name
|
1094
1094
|
unmatched_alias_list = @unmatched_alias_lists[key]
|
@@ -1139,7 +1139,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
1139
1139
|
##
|
1140
1140
|
# Sets the current section to a section with +title+. See also #add_section
|
1141
1141
|
|
1142
|
-
def set_current_section
|
1142
|
+
def set_current_section(title, comment)
|
1143
1143
|
@current_section = add_section title, comment
|
1144
1144
|
end
|
1145
1145
|
|
@@ -1204,7 +1204,7 @@ class RDoc::Context < RDoc::CodeObject
|
|
1204
1204
|
##
|
1205
1205
|
# Upgrades NormalModule +mod+ in +enclosing+ to a +class_type+
|
1206
1206
|
|
1207
|
-
def upgrade_to_class
|
1207
|
+
def upgrade_to_class(mod, class_type, enclosing)
|
1208
1208
|
enclosing.modules_hash.delete mod.name
|
1209
1209
|
|
1210
1210
|
klass = RDoc::ClassModule.from_module class_type, mod
|
@@ -91,7 +91,7 @@ class RDoc::MethodAttr < RDoc::CodeObject
|
|
91
91
|
##
|
92
92
|
# Resets cached data for the object so it can be rebuilt by accessor methods
|
93
93
|
|
94
|
-
def initialize_copy
|
94
|
+
def initialize_copy(other) # :nodoc:
|
95
95
|
@full_name = nil
|
96
96
|
end
|
97
97
|
|
@@ -111,7 +111,7 @@ class RDoc::MethodAttr < RDoc::CodeObject
|
|
111
111
|
[other.singleton ? 0 : 1, other.name_ord_range, other.name]
|
112
112
|
end
|
113
113
|
|
114
|
-
def ==
|
114
|
+
def ==(other) # :nodoc:
|
115
115
|
equal?(other) or self.class == other.class and full_name == other.full_name
|
116
116
|
end
|
117
117
|
|
@@ -150,7 +150,7 @@ class RDoc::MethodAttr < RDoc::CodeObject
|
|
150
150
|
##
|
151
151
|
# Sets the store for this class or module and its contained code objects.
|
152
152
|
|
153
|
-
def store=
|
153
|
+
def store=(store)
|
154
154
|
super
|
155
155
|
|
156
156
|
@file = @store.add_file @file.full_name if @file
|
@@ -168,7 +168,7 @@ class RDoc::MethodAttr < RDoc::CodeObject
|
|
168
168
|
return find_method_or_attribute name[0..-2]
|
169
169
|
end
|
170
170
|
|
171
|
-
def find_method_or_attribute
|
171
|
+
def find_method_or_attribute(name) # :nodoc:
|
172
172
|
return nil unless parent.respond_to? :ancestors
|
173
173
|
|
174
174
|
searched = parent.ancestors
|
@@ -282,7 +282,8 @@ class RDoc::MethodAttr < RDoc::CodeObject
|
|
282
282
|
# HTML id-friendly method/attribute name
|
283
283
|
|
284
284
|
def html_name
|
285
|
-
require 'cgi/
|
285
|
+
require 'cgi/escape'
|
286
|
+
require 'cgi/util' unless defined?(CGI::EscapeExt)
|
286
287
|
|
287
288
|
CGI.escape(@name.gsub('-', '-2D')).gsub('%', '-').sub(/^-/, '')
|
288
289
|
end
|
@@ -341,7 +342,7 @@ class RDoc::MethodAttr < RDoc::CodeObject
|
|
341
342
|
@parent_name || super
|
342
343
|
end
|
343
344
|
|
344
|
-
def pretty_print
|
345
|
+
def pretty_print(q) # :nodoc:
|
345
346
|
alias_for =
|
346
347
|
if @is_alias_for.respond_to? :name then
|
347
348
|
"alias for #{@is_alias_for.name}"
|
@@ -23,13 +23,13 @@ class RDoc::Mixin < RDoc::CodeObject
|
|
23
23
|
##
|
24
24
|
# Mixins are sorted by name
|
25
25
|
|
26
|
-
def <=>
|
26
|
+
def <=>(other)
|
27
27
|
return unless self.class === other
|
28
28
|
|
29
29
|
name <=> other.name
|
30
30
|
end
|
31
31
|
|
32
|
-
def ==
|
32
|
+
def ==(other) # :nodoc:
|
33
33
|
self.class === other and @name == other.name
|
34
34
|
end
|
35
35
|
|
@@ -107,7 +107,7 @@ class RDoc::Mixin < RDoc::CodeObject
|
|
107
107
|
##
|
108
108
|
# Sets the store for this class or module and its contained code objects.
|
109
109
|
|
110
|
-
def store=
|
110
|
+
def store=(store)
|
111
111
|
super
|
112
112
|
|
113
113
|
@file = @store.add_file @file.full_name if @file
|
@@ -33,7 +33,7 @@ class RDoc::TopLevel < RDoc::Context
|
|
33
33
|
# is being generated outside the source dir +relative_name+ is relative to
|
34
34
|
# the source directory.
|
35
35
|
|
36
|
-
def initialize
|
36
|
+
def initialize(absolute_name, relative_name = absolute_name)
|
37
37
|
super()
|
38
38
|
@name = nil
|
39
39
|
@absolute_name = absolute_name
|
@@ -55,7 +55,7 @@ class RDoc::TopLevel < RDoc::Context
|
|
55
55
|
##
|
56
56
|
# An RDoc::TopLevel is equal to another with the same relative_name
|
57
57
|
|
58
|
-
def ==
|
58
|
+
def ==(other)
|
59
59
|
self.class === other and @relative_name == other.relative_name
|
60
60
|
end
|
61
61
|
|
@@ -73,7 +73,7 @@ class RDoc::TopLevel < RDoc::Context
|
|
73
73
|
##
|
74
74
|
# Adds +constant+ to +Object+ instead of +self+.
|
75
75
|
|
76
|
-
def add_constant
|
76
|
+
def add_constant(constant)
|
77
77
|
object_class.record_location self
|
78
78
|
return constant unless @document_self
|
79
79
|
object_class.add_constant constant
|
@@ -101,7 +101,7 @@ class RDoc::TopLevel < RDoc::Context
|
|
101
101
|
# Adds class or module +mod+. Used in the building phase
|
102
102
|
# by the Ruby parser.
|
103
103
|
|
104
|
-
def add_to_classes_or_modules
|
104
|
+
def add_to_classes_or_modules(mod)
|
105
105
|
@classes_or_modules << mod
|
106
106
|
end
|
107
107
|
|
@@ -128,7 +128,7 @@ class RDoc::TopLevel < RDoc::Context
|
|
128
128
|
# TODO Why do we search through all classes/modules found, not just the
|
129
129
|
# ones of this instance?
|
130
130
|
|
131
|
-
def find_class_or_module
|
131
|
+
def find_class_or_module(name)
|
132
132
|
@store.find_class_or_module name
|
133
133
|
end
|
134
134
|
|
@@ -192,7 +192,7 @@ class RDoc::TopLevel < RDoc::Context
|
|
192
192
|
##
|
193
193
|
# Loads this TopLevel from +array+.
|
194
194
|
|
195
|
-
def marshal_load
|
195
|
+
def marshal_load(array) # :nodoc:
|
196
196
|
initialize array[1]
|
197
197
|
|
198
198
|
@parser = array[2]
|
@@ -231,7 +231,7 @@ class RDoc::TopLevel < RDoc::Context
|
|
231
231
|
File.join(prefix, http_url)
|
232
232
|
end
|
233
233
|
|
234
|
-
def pretty_print
|
234
|
+
def pretty_print(q) # :nodoc:
|
235
235
|
q.group 2, "[#{self.class}: ", "]" do
|
236
236
|
q.text "base name: #{base_name.inspect}"
|
237
237
|
q.breakable
|