rdoc 8.0.0 → 8.1.0
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/CONTRIBUTING.md +1 -3
- data/RI.md +75 -75
- data/exe/rdoc +2 -2
- data/lib/rdoc/code_object/alias.rb +71 -69
- data/lib/rdoc/code_object/any_method.rb +305 -303
- data/lib/rdoc/code_object/attr.rb +150 -148
- data/lib/rdoc/code_object/class_module.rb +798 -792
- data/lib/rdoc/code_object/constant.rb +175 -173
- data/lib/rdoc/code_object/context/section.rb +142 -138
- data/lib/rdoc/code_object/context.rb +926 -958
- data/lib/rdoc/code_object/extend.rb +7 -5
- data/lib/rdoc/code_object/include.rb +7 -5
- data/lib/rdoc/code_object/method_attr.rb +326 -319
- data/lib/rdoc/code_object/mixin.rb +97 -95
- data/lib/rdoc/code_object/normal_class.rb +77 -78
- data/lib/rdoc/code_object/normal_module.rb +61 -59
- data/lib/rdoc/code_object/require.rb +23 -39
- data/lib/rdoc/code_object/single_class.rb +21 -19
- data/lib/rdoc/code_object/top_level.rb +212 -219
- data/lib/rdoc/code_object.rb +305 -303
- data/lib/rdoc/comment.rb +275 -273
- data/lib/rdoc/cross_reference.rb +192 -190
- data/lib/rdoc/encoding.rb +105 -103
- data/lib/rdoc/erb_partial.rb +13 -11
- data/lib/rdoc/erbio.rb +29 -27
- data/lib/rdoc/generator/aliki.rb +161 -153
- data/lib/rdoc/generator/darkfish.rb +645 -635
- data/lib/rdoc/generator/json_index.rb +233 -229
- data/lib/rdoc/generator/markup.rb +164 -146
- data/lib/rdoc/generator/pot/message_extractor.rb +57 -51
- data/lib/rdoc/generator/pot/po.rb +52 -51
- data/lib/rdoc/generator/pot/po_entry.rb +138 -132
- data/lib/rdoc/generator/pot.rb +85 -81
- data/lib/rdoc/generator/ri.rb +23 -19
- data/lib/rdoc/generator/template/aliki/DESIGN.md +6 -4
- data/lib/rdoc/generator/template/aliki/_footer.rhtml +1 -1
- data/lib/rdoc/generator/template/aliki/_head.rhtml +10 -10
- data/lib/rdoc/generator/template/aliki/_header.rhtml +29 -44
- data/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +4 -4
- data/lib/rdoc/generator/template/aliki/css/rdoc.css +207 -178
- data/lib/rdoc/generator/template/aliki/js/aliki.js +60 -84
- data/lib/rdoc/generator/template/darkfish/_footer.rhtml +1 -1
- data/lib/rdoc/generator.rb +48 -46
- data/lib/rdoc/i18n/locale.rb +99 -95
- data/lib/rdoc/i18n/text.rb +109 -105
- data/lib/rdoc/i18n.rb +7 -5
- data/lib/rdoc/markdown/byte_runtime.rb +80 -0
- data/lib/rdoc/markdown.kpeg +15 -11
- data/lib/rdoc/markdown.rb +40 -47
- data/lib/rdoc/markup/block_quote.rb +12 -8
- data/lib/rdoc/markup/document.rb +127 -123
- data/lib/rdoc/markup/formatter.rb +219 -215
- data/lib/rdoc/markup/include.rb +33 -29
- data/lib/rdoc/markup/indented_paragraph.rb +37 -33
- data/lib/rdoc/markup/inline_parser.rb +281 -277
- data/lib/rdoc/markup/list.rb +80 -88
- data/lib/rdoc/markup/list_item.rb +73 -85
- data/lib/rdoc/markup/paragraph.rb +23 -19
- data/lib/rdoc/markup/parser.rb +501 -497
- data/lib/rdoc/markup/pre_process.rb +283 -279
- data/lib/rdoc/markup/raw.rb +2 -2
- data/lib/rdoc/markup/rule.rb +16 -12
- data/lib/rdoc/markup/to_ansi.rb +143 -139
- data/lib/rdoc/markup/to_bs.rb +72 -68
- data/lib/rdoc/markup/to_html.rb +594 -565
- data/lib/rdoc/markup/to_html_crossref.rb +234 -230
- data/lib/rdoc/markup/to_html_snippet.rb +232 -227
- data/lib/rdoc/markup/to_joined_paragraph.rb +36 -32
- data/lib/rdoc/markup/to_label.rb +63 -59
- data/lib/rdoc/markup/to_markdown.rb +212 -208
- data/lib/rdoc/markup/to_rdoc.rb +336 -332
- data/lib/rdoc/markup/to_table_of_contents.rb +66 -62
- data/lib/rdoc/markup/to_test.rb +60 -56
- data/lib/rdoc/markup/to_tt_only.rb +84 -80
- data/lib/rdoc/markup/verbatim.rb +62 -58
- data/lib/rdoc/markup.rb +198 -196
- data/lib/rdoc/options.rb +1063 -1061
- data/lib/rdoc/parser/c.rb +1039 -1037
- data/lib/rdoc/parser/changelog.rb +319 -315
- data/lib/rdoc/parser/markdown.rb +17 -13
- data/lib/rdoc/parser/rbs.rb +239 -235
- data/lib/rdoc/parser/rd.rb +17 -13
- data/lib/rdoc/parser/ruby.rb +1245 -1124
- data/lib/rdoc/parser/ruby_colorizer.rb +263 -213
- data/lib/rdoc/parser/simple.rb +31 -27
- data/lib/rdoc/parser/text.rb +12 -8
- data/lib/rdoc/parser.rb +228 -220
- data/lib/rdoc/rbs_helper.rb +1 -1
- data/lib/rdoc/rd/inline.rb +57 -53
- data/lib/rdoc/rd.rb +90 -88
- data/lib/rdoc/rdoc.rb +500 -491
- data/lib/rdoc/ri/driver.rb +1140 -1135
- data/lib/rdoc/ri/formatter.rb +7 -3
- data/lib/rdoc/ri/paths.rb +140 -136
- data/lib/rdoc/ri/servlet.rb +354 -350
- data/lib/rdoc/ri/store.rb +4 -2
- data/lib/rdoc/ri/task.rb +55 -51
- data/lib/rdoc/ri.rb +14 -12
- data/lib/rdoc/rubygems_hook.rb +183 -181
- data/lib/rdoc/server.rb +349 -347
- data/lib/rdoc/stats/normal.rb +46 -42
- data/lib/rdoc/stats/quiet.rb +39 -35
- data/lib/rdoc/stats/verbose.rb +35 -31
- data/lib/rdoc/stats.rb +365 -363
- data/lib/rdoc/store.rb +888 -902
- data/lib/rdoc/task.rb +260 -256
- data/lib/rdoc/text.rb +135 -133
- data/lib/rdoc/token_stream.rb +101 -93
- data/lib/rdoc/tom_doc.rb +203 -201
- data/lib/rdoc/version.rb +1 -1
- metadata +4 -5
- data/lib/rdoc/markdown/literals.kpeg +0 -21
- data/lib/rdoc/markdown/literals.rb +0 -454
|
@@ -1,123 +1,125 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
#
|
|
2
|
+
module RDoc
|
|
3
|
+
##
|
|
4
|
+
# A Mixin adds features from a module into another context. RDoc::Include and
|
|
5
|
+
# RDoc::Extend are both mixins.
|
|
5
6
|
|
|
6
|
-
class
|
|
7
|
+
class Mixin < CodeObject
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
##
|
|
10
|
+
# Name of included module
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
attr_accessor :name
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
##
|
|
15
|
+
# Creates a new Mixin for +name+ with +comment+
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
def initialize(name, comment)
|
|
18
|
+
super()
|
|
19
|
+
@name = name
|
|
20
|
+
self.comment = comment
|
|
21
|
+
@module = nil # cache for module if found
|
|
22
|
+
end
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
##
|
|
25
|
+
# Mixins are sorted by name
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
def <=>(other)
|
|
28
|
+
return unless self.class === other
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
name <=> other.name
|
|
31
|
+
end
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
def ==(other) # :nodoc:
|
|
34
|
+
self.class === other and @name == other.name
|
|
35
|
+
end
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
alias eql? == # :nodoc:
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
##
|
|
40
|
+
# Full name based on #module
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
def full_name
|
|
43
|
+
m = self.module
|
|
44
|
+
ClassModule === m ? m.full_name : @name
|
|
45
|
+
end
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
def hash # :nodoc:
|
|
48
|
+
[@name, self.module].hash
|
|
49
|
+
end
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
def inspect # :nodoc:
|
|
52
|
+
"#<%s:0x%x %s.%s %s>" % [
|
|
53
|
+
self.class,
|
|
54
|
+
object_id,
|
|
55
|
+
parent_name, self.class.name.downcase, @name,
|
|
56
|
+
]
|
|
57
|
+
end
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return @module if @module
|
|
80
|
-
|
|
81
|
-
# search the current context
|
|
82
|
-
return @name unless parent
|
|
83
|
-
full_name = parent.child_name(@name)
|
|
84
|
-
@module = @store.modules_hash[full_name]
|
|
85
|
-
return @module if @module
|
|
86
|
-
return @name if @name =~ /^::/
|
|
87
|
-
|
|
88
|
-
# search the includes before this one, in reverse order
|
|
89
|
-
searched = parent.includes.take_while { |i| i != self }.reverse
|
|
90
|
-
searched.each do |i|
|
|
91
|
-
inc = i.module
|
|
92
|
-
next if String === inc
|
|
93
|
-
full_name = inc.child_name(@name)
|
|
94
|
-
@module = @store.modules_hash[full_name]
|
|
59
|
+
##
|
|
60
|
+
# Attempts to locate the included module object. Returns the name if not
|
|
61
|
+
# known.
|
|
62
|
+
#
|
|
63
|
+
# The scoping rules of Ruby to resolve the name of an included module are:
|
|
64
|
+
# - first look into the children of the current context;
|
|
65
|
+
# - if not found, look into the children of included modules,
|
|
66
|
+
# in reverse inclusion order;
|
|
67
|
+
# - if still not found, go up the hierarchy of names.
|
|
68
|
+
#
|
|
69
|
+
# This method has <code>O(n!)</code> behavior when the module calling
|
|
70
|
+
# include is referencing nonexistent modules. Avoid calling #module until
|
|
71
|
+
# after all the files are parsed. This behavior is due to ruby's constant
|
|
72
|
+
# lookup behavior.
|
|
73
|
+
#
|
|
74
|
+
# As of the beginning of October, 2011, no gem includes nonexistent modules.
|
|
75
|
+
#
|
|
76
|
+
# The Ruby parser passes an already-resolved full-path +name+, so most of this
|
|
77
|
+
# logic only runs for the C parser, which passes the unresolved local name.
|
|
78
|
+
|
|
79
|
+
def module
|
|
95
80
|
return @module if @module
|
|
96
|
-
end
|
|
97
81
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
full_name = up.child_name(@name)
|
|
82
|
+
# search the current context
|
|
83
|
+
return @name unless parent
|
|
84
|
+
full_name = parent.child_name(@name)
|
|
102
85
|
@module = @store.modules_hash[full_name]
|
|
103
86
|
return @module if @module
|
|
104
|
-
|
|
87
|
+
return @name if @name =~ /^::/
|
|
88
|
+
|
|
89
|
+
# search the includes before this one, in reverse order
|
|
90
|
+
searched = parent.includes.take_while { |i| i != self }.reverse
|
|
91
|
+
searched.each do |i|
|
|
92
|
+
inc = i.module
|
|
93
|
+
next if String === inc
|
|
94
|
+
full_name = inc.child_name(@name)
|
|
95
|
+
@module = @store.modules_hash[full_name]
|
|
96
|
+
return @module if @module
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# go up the hierarchy of names
|
|
100
|
+
up = parent.parent
|
|
101
|
+
while up
|
|
102
|
+
full_name = up.child_name(@name)
|
|
103
|
+
@module = @store.modules_hash[full_name]
|
|
104
|
+
return @module if @module
|
|
105
|
+
up = up.parent
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
@name
|
|
105
109
|
end
|
|
106
110
|
|
|
107
|
-
|
|
108
|
-
|
|
111
|
+
##
|
|
112
|
+
# Sets the store for this class or module and its contained code objects.
|
|
109
113
|
|
|
110
|
-
|
|
111
|
-
|
|
114
|
+
def store=(store)
|
|
115
|
+
super
|
|
112
116
|
|
|
113
|
-
|
|
114
|
-
|
|
117
|
+
@file = @store.add_file @file.full_name if @file
|
|
118
|
+
end
|
|
115
119
|
|
|
116
|
-
|
|
117
|
-
|
|
120
|
+
def to_s # :nodoc:
|
|
121
|
+
"#{self.class.name.downcase} #@name in: #{parent}"
|
|
122
|
+
end
|
|
118
123
|
|
|
119
|
-
def to_s # :nodoc:
|
|
120
|
-
"#{self.class.name.downcase} #@name in: #{parent}"
|
|
121
124
|
end
|
|
122
|
-
|
|
123
125
|
end
|
|
@@ -1,92 +1,91 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# A normal class, neither singleton nor anonymous
|
|
4
|
-
|
|
5
|
-
class RDoc::NormalClass < RDoc::ClassModule
|
|
6
|
-
|
|
2
|
+
module RDoc
|
|
7
3
|
##
|
|
8
|
-
#
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
ancestors
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
# A normal class, neither singleton nor anonymous
|
|
5
|
+
|
|
6
|
+
class NormalClass < ClassModule
|
|
7
|
+
|
|
8
|
+
##
|
|
9
|
+
# The ancestors of this class including modules. Unlike Module#ancestors,
|
|
10
|
+
# this class is not included in the result. The result will contain both
|
|
11
|
+
# RDoc::ClassModules and Strings.
|
|
12
|
+
|
|
13
|
+
def ancestors
|
|
14
|
+
ancestors = included_ancestors
|
|
15
|
+
super_classes.each do |sclass|
|
|
16
|
+
ancestors << sclass
|
|
17
|
+
ancestors.concat sclass.included_ancestors unless String === sclass
|
|
18
|
+
end
|
|
19
|
+
ancestors
|
|
21
20
|
end
|
|
22
|
-
end
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
def aref_prefix # :nodoc:
|
|
23
|
+
'class'
|
|
24
|
+
end
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
##
|
|
27
|
+
# The definition of this class, <tt>class MyClassName</tt>
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
def definition
|
|
30
|
+
"class #{full_name}"
|
|
31
|
+
end
|
|
34
32
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
def direct_ancestors
|
|
34
|
+
superclass ? super + [superclass] : super
|
|
35
|
+
end
|
|
38
36
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
def inspect # :nodoc:
|
|
38
|
+
superclass = @superclass ? " < #{@superclass}" : nil
|
|
39
|
+
"<%s:0x%x class %s%s includes: %p extends: %p attributes: %p methods: %p aliases: %p>" % [
|
|
40
|
+
self.class, object_id,
|
|
41
|
+
full_name, superclass, @includes, @extends, @attributes, @method_list, @aliases
|
|
42
|
+
]
|
|
43
|
+
end
|
|
46
44
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
def to_s # :nodoc:
|
|
46
|
+
display = "#{self.class.name} #{self.full_name}"
|
|
47
|
+
if superclass
|
|
48
|
+
display += ' < ' + (superclass.is_a?(String) ? superclass : superclass.full_name)
|
|
49
|
+
end
|
|
50
|
+
display += ' -> ' + is_alias_for.to_s if is_alias_for
|
|
51
|
+
display
|
|
51
52
|
end
|
|
52
|
-
display += ' -> ' + is_alias_for.to_s if is_alias_for
|
|
53
|
-
display
|
|
54
|
-
end
|
|
55
53
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
54
|
+
def pretty_print(q) # :nodoc:
|
|
55
|
+
superclass = @superclass ? " < #{@superclass}" : nil
|
|
56
|
+
|
|
57
|
+
q.group 2, "[class #{full_name}#{superclass}", "]" do
|
|
58
|
+
q.breakable
|
|
59
|
+
q.text "includes:"
|
|
60
|
+
q.breakable
|
|
61
|
+
q.seplist @includes do |inc| q.pp inc end
|
|
62
|
+
|
|
63
|
+
q.breakable
|
|
64
|
+
q.text "constants:"
|
|
65
|
+
q.breakable
|
|
66
|
+
q.seplist @constants do |const| q.pp const end
|
|
67
|
+
|
|
68
|
+
q.breakable
|
|
69
|
+
q.text "attributes:"
|
|
70
|
+
q.breakable
|
|
71
|
+
q.seplist @attributes do |attr| q.pp attr end
|
|
72
|
+
|
|
73
|
+
q.breakable
|
|
74
|
+
q.text "methods:"
|
|
75
|
+
q.breakable
|
|
76
|
+
q.seplist @method_list do |meth| q.pp meth end
|
|
77
|
+
|
|
78
|
+
q.breakable
|
|
79
|
+
q.text "aliases:"
|
|
80
|
+
q.breakable
|
|
81
|
+
q.seplist @aliases do |aliaz| q.pp aliaz end
|
|
82
|
+
|
|
83
|
+
q.breakable
|
|
84
|
+
q.text "comment:"
|
|
85
|
+
q.breakable
|
|
86
|
+
q.pp comment
|
|
87
|
+
end
|
|
89
88
|
end
|
|
90
|
-
end
|
|
91
89
|
|
|
90
|
+
end
|
|
92
91
|
end
|
|
@@ -1,73 +1,75 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
module RDoc
|
|
3
|
+
##
|
|
4
|
+
# A normal module, like NormalClass
|
|
4
5
|
|
|
5
|
-
class
|
|
6
|
+
class NormalModule < ClassModule
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
def aref_prefix # :nodoc:
|
|
9
|
+
'module'
|
|
10
|
+
end
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
def inspect # :nodoc:
|
|
13
|
+
"#<%s:0x%x module %s includes: %p extends: %p attributes: %p methods: %p aliases: %p>" % [
|
|
14
|
+
self.class, object_id,
|
|
15
|
+
full_name, @includes, @extends, @attributes, @method_list, @aliases
|
|
16
|
+
]
|
|
17
|
+
end
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
##
|
|
20
|
+
# The definition of this module, <tt>module MyModuleName</tt>
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
def definition
|
|
23
|
+
"module #{full_name}"
|
|
24
|
+
end
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
##
|
|
27
|
+
# This is a module, returns true
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
def module?
|
|
30
|
+
true
|
|
31
|
+
end
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
33
|
+
def pretty_print(q) # :nodoc:
|
|
34
|
+
q.group 2, "[module #{full_name}:", "]" do
|
|
35
|
+
q.breakable
|
|
36
|
+
q.text "includes:"
|
|
37
|
+
q.breakable
|
|
38
|
+
q.seplist @includes do |inc| q.pp inc end
|
|
39
|
+
q.breakable
|
|
40
|
+
|
|
41
|
+
q.breakable
|
|
42
|
+
q.text "constants:"
|
|
43
|
+
q.breakable
|
|
44
|
+
q.seplist @constants do |const| q.pp const end
|
|
45
|
+
|
|
46
|
+
q.text "attributes:"
|
|
47
|
+
q.breakable
|
|
48
|
+
q.seplist @attributes do |attr| q.pp attr end
|
|
49
|
+
q.breakable
|
|
50
|
+
|
|
51
|
+
q.text "methods:"
|
|
52
|
+
q.breakable
|
|
53
|
+
q.seplist @method_list do |meth| q.pp meth end
|
|
54
|
+
q.breakable
|
|
55
|
+
|
|
56
|
+
q.text "aliases:"
|
|
57
|
+
q.breakable
|
|
58
|
+
q.seplist @aliases do |aliaz| q.pp aliaz end
|
|
59
|
+
q.breakable
|
|
60
|
+
|
|
61
|
+
q.text "comment:"
|
|
62
|
+
q.breakable
|
|
63
|
+
q.pp comment
|
|
64
|
+
end
|
|
63
65
|
end
|
|
64
|
-
end
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
##
|
|
68
|
+
# Modules don't have one, raises NoMethodError
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
def superclass
|
|
71
|
+
raise NoMethodError, "#{full_name} is a module"
|
|
72
|
+
end
|
|
72
73
|
|
|
74
|
+
end
|
|
73
75
|
end
|
|
@@ -1,51 +1,35 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# A file loaded by \#require
|
|
4
|
-
|
|
5
|
-
class RDoc::Require < RDoc::CodeObject
|
|
6
|
-
|
|
7
|
-
##
|
|
8
|
-
# Name of the required file
|
|
9
|
-
|
|
10
|
-
attr_accessor :name
|
|
11
|
-
|
|
2
|
+
module RDoc
|
|
12
3
|
##
|
|
13
|
-
#
|
|
4
|
+
# A file loaded by \#require
|
|
14
5
|
|
|
15
|
-
|
|
16
|
-
super()
|
|
17
|
-
@name = name.gsub(/'|"/, "") #'
|
|
18
|
-
@top_level = nil
|
|
19
|
-
self.comment = comment
|
|
20
|
-
end
|
|
6
|
+
class Require < CodeObject
|
|
21
7
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
self.class,
|
|
25
|
-
object_id,
|
|
26
|
-
@name,
|
|
27
|
-
@parent ? @parent.base_name : '(unknown)'
|
|
28
|
-
]
|
|
29
|
-
end
|
|
8
|
+
##
|
|
9
|
+
# Name of the required file
|
|
30
10
|
|
|
31
|
-
|
|
32
|
-
"require #{name} in: #{parent}"
|
|
33
|
-
end
|
|
11
|
+
attr_accessor :name
|
|
34
12
|
|
|
35
|
-
|
|
36
|
-
|
|
13
|
+
##
|
|
14
|
+
# Creates a new Require that loads +name+ with +comment+
|
|
37
15
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
16
|
+
def initialize(name, comment)
|
|
17
|
+
super()
|
|
18
|
+
@name = name.gsub(/'|"/, "")
|
|
19
|
+
self.comment = comment
|
|
20
|
+
end
|
|
41
21
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
22
|
+
def inspect # :nodoc:
|
|
23
|
+
"#<%s:0x%x require '%s' in %s>" % [
|
|
24
|
+
self.class,
|
|
25
|
+
object_id,
|
|
26
|
+
@name,
|
|
27
|
+
@parent ? @parent.base_name : '(unknown)'
|
|
28
|
+
]
|
|
29
|
+
end
|
|
46
30
|
|
|
47
|
-
|
|
31
|
+
def to_s # :nodoc:
|
|
32
|
+
"require #{name} in: #{parent}"
|
|
48
33
|
end
|
|
49
34
|
end
|
|
50
|
-
|
|
51
35
|
end
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
module RDoc
|
|
3
|
+
##
|
|
4
|
+
# A singleton class
|
|
4
5
|
|
|
5
|
-
class
|
|
6
|
+
class SingleClass < ClassModule
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
##
|
|
9
|
+
# Adds the superclass to the included modules.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
def ancestors
|
|
12
|
+
superclass ? super + [superclass] : super
|
|
13
|
+
end
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
def aref_prefix # :nodoc:
|
|
16
|
+
'sclass'
|
|
17
|
+
end
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
##
|
|
20
|
+
# The definition of this singleton class, <tt>class << MyClassName</tt>
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
def definition
|
|
23
|
+
"class << #{full_name}"
|
|
24
|
+
end
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
def pretty_print(q) # :nodoc:
|
|
27
|
+
q.group 2, "[class << #{full_name}", "]" do
|
|
28
|
+
next
|
|
29
|
+
end
|
|
28
30
|
end
|
|
29
31
|
end
|
|
30
32
|
end
|