super-quick-rb 0.0.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 +7 -0
- data/rdoc-8.0.0/CONTRIBUTING.md +195 -0
- data/rdoc-8.0.0/CVE-2013-0256.rdoc +49 -0
- data/rdoc-8.0.0/History.rdoc +1668 -0
- data/rdoc-8.0.0/LEGAL.rdoc +56 -0
- data/rdoc-8.0.0/LICENSE.rdoc +63 -0
- data/rdoc-8.0.0/README.md +236 -0
- data/rdoc-8.0.0/RI.md +842 -0
- data/rdoc-8.0.0/TODO.rdoc +60 -0
- data/rdoc-8.0.0/doc/markup_reference/markdown.md +659 -0
- data/rdoc-8.0.0/doc/markup_reference/rdoc.rdoc +1169 -0
- data/rdoc-8.0.0/exe/rdoc +43 -0
- data/rdoc-8.0.0/exe/ri +12 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/alias.rb +98 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/any_method.rb +387 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/attr.rb +178 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/class_module.rb +969 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/constant.rb +221 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/context/section.rb +182 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/context.rb +1238 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/extend.rb +9 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/include.rb +9 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/method_attr.rb +417 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/mixin.rb +123 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/normal_class.rb +92 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/normal_module.rb +73 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/require.rb +51 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/single_class.rb +30 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/top_level.rb +286 -0
- data/rdoc-8.0.0/lib/rdoc/code_object.rb +393 -0
- data/rdoc-8.0.0/lib/rdoc/code_objects.rb +5 -0
- data/rdoc-8.0.0/lib/rdoc/comment.rb +353 -0
- data/rdoc-8.0.0/lib/rdoc/cross_reference.rb +215 -0
- data/rdoc-8.0.0/lib/rdoc/encoding.rb +120 -0
- data/rdoc-8.0.0/lib/rdoc/erb_partial.rb +18 -0
- data/rdoc-8.0.0/lib/rdoc/erbio.rb +37 -0
- data/rdoc-8.0.0/lib/rdoc/generator/aliki.rb +200 -0
- data/rdoc-8.0.0/lib/rdoc/generator/darkfish.rb +824 -0
- data/rdoc-8.0.0/lib/rdoc/generator/json_index.rb +284 -0
- data/rdoc-8.0.0/lib/rdoc/generator/markup.rb +196 -0
- data/rdoc-8.0.0/lib/rdoc/generator/pot/message_extractor.rb +68 -0
- data/rdoc-8.0.0/lib/rdoc/generator/pot/po.rb +84 -0
- data/rdoc-8.0.0/lib/rdoc/generator/pot/po_entry.rb +141 -0
- data/rdoc-8.0.0/lib/rdoc/generator/pot.rb +94 -0
- data/rdoc-8.0.0/lib/rdoc/generator/ri.rb +30 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/DESIGN.md +536 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_aside_toc.rhtml +8 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_footer.rhtml +23 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_head.rhtml +163 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_header.rhtml +56 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_icons.rhtml +208 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_ancestors.rhtml +16 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_classes.rhtml +15 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +27 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +27 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml +16 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_methods.rhtml +41 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +67 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +15 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +21 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml +3 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/class.rhtml +230 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/css/rdoc.css +2181 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/index.rhtml +22 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/aliki.js +513 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/bash_highlighter.js +167 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/c_highlighter.js +299 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/search_controller.js +129 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/search_navigation.js +105 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/search_ranker.js +239 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/theme-toggle.js +112 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/page.rhtml +18 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +14 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/servlet_root.rhtml +65 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_footer.rhtml +5 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_head.rhtml +43 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +5 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +17 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +17 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +16 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +21 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml +11 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +32 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +6 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +15 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +11 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +39 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_toggle.rhtml +3 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/class.rhtml +220 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/css/fonts.css +167 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/css/rdoc.css +701 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/add.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/arrow_up.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/brick.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/brick_link.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bug.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bullet_black.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/date.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/delete.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/find.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/macFFBgHack.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/package.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/page_green.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/page_white_text.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/page_white_width.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/plugin.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/ruby.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/tag_blue.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/tag_green.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/transparent.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/wrench.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/wrench_orange.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/zoom.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/index.rhtml +24 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/js/darkfish.js +140 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/js/search.js +120 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/page.rhtml +19 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +21 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +65 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +72 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/json_index/js/navigation.js +105 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/json_index/js/searcher.js +271 -0
- data/rdoc-8.0.0/lib/rdoc/generator.rb +52 -0
- data/rdoc-8.0.0/lib/rdoc/i18n/locale.rb +102 -0
- data/rdoc-8.0.0/lib/rdoc/i18n/text.rb +126 -0
- data/rdoc-8.0.0/lib/rdoc/i18n.rb +10 -0
- data/rdoc-8.0.0/lib/rdoc/known_classes.rb +74 -0
- data/rdoc-8.0.0/lib/rdoc/markdown/entities.rb +2131 -0
- data/rdoc-8.0.0/lib/rdoc/markdown/literals.kpeg +21 -0
- data/rdoc-8.0.0/lib/rdoc/markdown/literals.rb +454 -0
- data/rdoc-8.0.0/lib/rdoc/markdown.kpeg +1315 -0
- data/rdoc-8.0.0/lib/rdoc/markdown.rb +16865 -0
- data/rdoc-8.0.0/lib/rdoc/markup/blank_line.rb +29 -0
- data/rdoc-8.0.0/lib/rdoc/markup/block_quote.rb +14 -0
- data/rdoc-8.0.0/lib/rdoc/markup/document.rb +164 -0
- data/rdoc-8.0.0/lib/rdoc/markup/element.rb +21 -0
- data/rdoc-8.0.0/lib/rdoc/markup/formatter.rb +285 -0
- data/rdoc-8.0.0/lib/rdoc/markup/hard_break.rb +34 -0
- data/rdoc-8.0.0/lib/rdoc/markup/heading.rb +170 -0
- data/rdoc-8.0.0/lib/rdoc/markup/include.rb +42 -0
- data/rdoc-8.0.0/lib/rdoc/markup/indented_paragraph.rb +47 -0
- data/rdoc-8.0.0/lib/rdoc/markup/inline_parser.rb +312 -0
- data/rdoc-8.0.0/lib/rdoc/markup/list.rb +101 -0
- data/rdoc-8.0.0/lib/rdoc/markup/list_item.rb +99 -0
- data/rdoc-8.0.0/lib/rdoc/markup/paragraph.rb +28 -0
- data/rdoc-8.0.0/lib/rdoc/markup/parser.rb +585 -0
- data/rdoc-8.0.0/lib/rdoc/markup/pre_process.rb +317 -0
- data/rdoc-8.0.0/lib/rdoc/markup/raw.rb +66 -0
- data/rdoc-8.0.0/lib/rdoc/markup/rule.rb +20 -0
- data/rdoc-8.0.0/lib/rdoc/markup/table.rb +64 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_ansi.rb +144 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_bs.rb +86 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_html.rb +682 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_html_crossref.rb +261 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_html_snippet.rb +287 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_joined_paragraph.rb +41 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_label.rb +84 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_markdown.rb +215 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_rdoc.rb +421 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_table_of_contents.rb +88 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_test.rb +77 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_tt_only.rb +107 -0
- data/rdoc-8.0.0/lib/rdoc/markup/verbatim.rb +83 -0
- data/rdoc-8.0.0/lib/rdoc/markup.rb +219 -0
- data/rdoc-8.0.0/lib/rdoc/options.rb +1412 -0
- data/rdoc-8.0.0/lib/rdoc/parser/c.rb +1227 -0
- data/rdoc-8.0.0/lib/rdoc/parser/changelog.rb +379 -0
- data/rdoc-8.0.0/lib/rdoc/parser/markdown.rb +22 -0
- data/rdoc-8.0.0/lib/rdoc/parser/rbs.rb +275 -0
- data/rdoc-8.0.0/lib/rdoc/parser/rd.rb +22 -0
- data/rdoc-8.0.0/lib/rdoc/parser/ruby.rb +1266 -0
- data/rdoc-8.0.0/lib/rdoc/parser/ruby_colorizer.rb +253 -0
- data/rdoc-8.0.0/lib/rdoc/parser/simple.rb +44 -0
- data/rdoc-8.0.0/lib/rdoc/parser/text.rb +11 -0
- data/rdoc-8.0.0/lib/rdoc/parser.rb +298 -0
- data/rdoc-8.0.0/lib/rdoc/rbs_helper.rb +186 -0
- data/rdoc-8.0.0/lib/rdoc/rd/block_parser.rb +1706 -0
- data/rdoc-8.0.0/lib/rdoc/rd/block_parser.ry +643 -0
- data/rdoc-8.0.0/lib/rdoc/rd/inline.rb +71 -0
- data/rdoc-8.0.0/lib/rdoc/rd/inline_parser.rb +1854 -0
- data/rdoc-8.0.0/lib/rdoc/rd/inline_parser.ry +593 -0
- data/rdoc-8.0.0/lib/rdoc/rd.rb +99 -0
- data/rdoc-8.0.0/lib/rdoc/rdoc.rb +724 -0
- data/rdoc-8.0.0/lib/rdoc/ri/driver.rb +1572 -0
- data/rdoc-8.0.0/lib/rdoc/ri/formatter.rb +6 -0
- data/rdoc-8.0.0/lib/rdoc/ri/paths.rb +171 -0
- data/rdoc-8.0.0/lib/rdoc/ri/servlet.rb +452 -0
- data/rdoc-8.0.0/lib/rdoc/ri/store.rb +6 -0
- data/rdoc-8.0.0/lib/rdoc/ri/task.rb +71 -0
- data/rdoc-8.0.0/lib/rdoc/ri.rb +21 -0
- data/rdoc-8.0.0/lib/rdoc/rubygems_hook.rb +327 -0
- data/rdoc-8.0.0/lib/rdoc/server.rb +460 -0
- data/rdoc-8.0.0/lib/rdoc/stats/normal.rb +58 -0
- data/rdoc-8.0.0/lib/rdoc/stats/quiet.rb +59 -0
- data/rdoc-8.0.0/lib/rdoc/stats/verbose.rb +44 -0
- data/rdoc-8.0.0/lib/rdoc/stats.rb +484 -0
- data/rdoc-8.0.0/lib/rdoc/store.rb +1205 -0
- data/rdoc-8.0.0/lib/rdoc/task.rb +355 -0
- data/rdoc-8.0.0/lib/rdoc/text.rb +244 -0
- data/rdoc-8.0.0/lib/rdoc/token_stream.rb +104 -0
- data/rdoc-8.0.0/lib/rdoc/tom_doc.rb +257 -0
- data/rdoc-8.0.0/lib/rdoc/version.rb +10 -0
- data/rdoc-8.0.0/lib/rdoc.rb +239 -0
- data/rdoc-8.0.0/lib/rubygems_plugin.rb +14 -0
- data/rdoc-8.0.0/man/ri.1 +249 -0
- data/rdoc-8.0.0/rdoc-logo.svg +43 -0
- data/rdoc-8.0.0/rdoc.gemspec +74 -0
- data/super-quick-rb.gemspec +12 -0
- metadata +257 -0
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
##
|
|
3
|
+
# Abstract class representing either a method or an attribute.
|
|
4
|
+
|
|
5
|
+
class RDoc::MethodAttr < RDoc::CodeObject
|
|
6
|
+
|
|
7
|
+
include Comparable
|
|
8
|
+
|
|
9
|
+
##
|
|
10
|
+
# Name of this method/attribute.
|
|
11
|
+
|
|
12
|
+
attr_accessor :name
|
|
13
|
+
|
|
14
|
+
##
|
|
15
|
+
# public, protected, private
|
|
16
|
+
|
|
17
|
+
attr_accessor :visibility
|
|
18
|
+
|
|
19
|
+
##
|
|
20
|
+
# Is this a singleton method/attribute?
|
|
21
|
+
|
|
22
|
+
attr_accessor :singleton
|
|
23
|
+
|
|
24
|
+
##
|
|
25
|
+
# Array of other names for this method/attribute
|
|
26
|
+
|
|
27
|
+
attr_reader :aliases
|
|
28
|
+
|
|
29
|
+
##
|
|
30
|
+
# The method/attribute we're aliasing
|
|
31
|
+
|
|
32
|
+
attr_accessor :is_alias_for
|
|
33
|
+
|
|
34
|
+
#--
|
|
35
|
+
# The attributes below are for AnyMethod only.
|
|
36
|
+
# They are left here for the time being to
|
|
37
|
+
# allow ri to operate.
|
|
38
|
+
# TODO modify ri to avoid calling these on attributes.
|
|
39
|
+
#++
|
|
40
|
+
|
|
41
|
+
##
|
|
42
|
+
# Parameters yielded by the called block
|
|
43
|
+
|
|
44
|
+
attr_reader :block_params
|
|
45
|
+
|
|
46
|
+
##
|
|
47
|
+
# Parameters for this method
|
|
48
|
+
|
|
49
|
+
attr_accessor :params
|
|
50
|
+
|
|
51
|
+
##
|
|
52
|
+
# Different ways to call this method
|
|
53
|
+
|
|
54
|
+
attr_accessor :call_seq
|
|
55
|
+
|
|
56
|
+
##
|
|
57
|
+
# RBS type signature lines from inline annotations or loaded .rbs files.
|
|
58
|
+
# Each entry is one overload or type expression.
|
|
59
|
+
|
|
60
|
+
attr_accessor :type_signature_lines
|
|
61
|
+
|
|
62
|
+
##
|
|
63
|
+
# The call_seq or the param_seq with method name, if there is no call_seq.
|
|
64
|
+
|
|
65
|
+
attr_reader :arglists
|
|
66
|
+
|
|
67
|
+
##
|
|
68
|
+
# Creates a new MethodAttr with method or attribute
|
|
69
|
+
# name +name+.
|
|
70
|
+
#
|
|
71
|
+
# Usually this is called by super from a subclass.
|
|
72
|
+
|
|
73
|
+
def initialize(name, singleton: false)
|
|
74
|
+
super()
|
|
75
|
+
|
|
76
|
+
@name = name
|
|
77
|
+
|
|
78
|
+
@aliases = []
|
|
79
|
+
@is_alias_for = nil
|
|
80
|
+
@parent_name = nil
|
|
81
|
+
@singleton = singleton
|
|
82
|
+
@visibility = :public
|
|
83
|
+
@see = false
|
|
84
|
+
|
|
85
|
+
@arglists = nil
|
|
86
|
+
@block_params = nil
|
|
87
|
+
@call_seq = nil
|
|
88
|
+
@params = nil
|
|
89
|
+
@type_signature_lines = nil
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
##
|
|
93
|
+
# Resets cached data for the object so it can be rebuilt by accessor methods
|
|
94
|
+
|
|
95
|
+
def initialize_copy(other) # :nodoc:
|
|
96
|
+
@full_name = nil
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def initialize_visibility # :nodoc:
|
|
100
|
+
super
|
|
101
|
+
@see = nil
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
##
|
|
105
|
+
# Order by #singleton then #name
|
|
106
|
+
|
|
107
|
+
def <=>(other)
|
|
108
|
+
return unless other.respond_to?(:singleton) &&
|
|
109
|
+
other.respond_to?(:name)
|
|
110
|
+
|
|
111
|
+
[@singleton ? 0 : 1, name_ord_range, name] <=>
|
|
112
|
+
[other.singleton ? 0 : 1, other.name_ord_range, other.name]
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def ==(other) # :nodoc:
|
|
116
|
+
equal?(other) or self.class == other.class and full_name == other.full_name
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
##
|
|
120
|
+
# A method/attribute is documented if any of the following is true:
|
|
121
|
+
# - it was marked with :nodoc:;
|
|
122
|
+
# - it has a comment;
|
|
123
|
+
# - it is an alias for a documented method;
|
|
124
|
+
# - it has a +#see+ method that is documented.
|
|
125
|
+
|
|
126
|
+
def documented?
|
|
127
|
+
super or
|
|
128
|
+
(is_alias_for and is_alias_for.documented?) or
|
|
129
|
+
(see and see.documented?)
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
##
|
|
133
|
+
# A method/attribute to look at,
|
|
134
|
+
# in particular if this method/attribute has no documentation.
|
|
135
|
+
#
|
|
136
|
+
# It can be a method/attribute of the superclass or of an included module,
|
|
137
|
+
# including the Kernel module, which is always appended to the included
|
|
138
|
+
# modules.
|
|
139
|
+
#
|
|
140
|
+
# Returns +nil+ if there is no such method/attribute.
|
|
141
|
+
# The +#is_alias_for+ method/attribute, if any, is not included.
|
|
142
|
+
#
|
|
143
|
+
# Templates may generate a "see also ..." if this method/attribute
|
|
144
|
+
# has documentation, and "see ..." if it does not.
|
|
145
|
+
|
|
146
|
+
def see
|
|
147
|
+
@see = find_see if @see == false
|
|
148
|
+
@see
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
##
|
|
152
|
+
# Sets the store for this class or module and its contained code objects.
|
|
153
|
+
|
|
154
|
+
def store=(store)
|
|
155
|
+
super
|
|
156
|
+
|
|
157
|
+
@file = @store.add_file @file.full_name if @file
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
def find_see # :nodoc:
|
|
161
|
+
return nil if singleton || is_alias_for
|
|
162
|
+
|
|
163
|
+
# look for the method
|
|
164
|
+
other = find_method_or_attribute name
|
|
165
|
+
return other if other
|
|
166
|
+
|
|
167
|
+
# if it is a setter, look for a getter
|
|
168
|
+
return nil unless name =~ /[a-z_]=$/i # avoid == or ===
|
|
169
|
+
return find_method_or_attribute name[0..-2]
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
def find_method_or_attribute(name) # :nodoc:
|
|
173
|
+
return nil unless parent.respond_to? :ancestors
|
|
174
|
+
|
|
175
|
+
searched = parent.ancestors
|
|
176
|
+
kernel = @store.modules_hash['Kernel']
|
|
177
|
+
|
|
178
|
+
searched << kernel if kernel &&
|
|
179
|
+
parent != kernel && !searched.include?(kernel)
|
|
180
|
+
|
|
181
|
+
searched.each do |ancestor|
|
|
182
|
+
next if String === ancestor
|
|
183
|
+
next if parent == ancestor
|
|
184
|
+
|
|
185
|
+
other = ancestor.find_method_named('#' + name) ||
|
|
186
|
+
ancestor.find_attribute_named(name)
|
|
187
|
+
|
|
188
|
+
return other if other
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
nil
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
##
|
|
195
|
+
# Abstract method. Contexts in their building phase call this
|
|
196
|
+
# to register a new alias for this known method/attribute.
|
|
197
|
+
#
|
|
198
|
+
# - creates a new AnyMethod/Attribute named <tt>an_alias.new_name</tt>;
|
|
199
|
+
# - adds +self+ as an alias for the new method or attribute
|
|
200
|
+
# - adds the method or attribute to #aliases
|
|
201
|
+
# - adds the method or attribute to +context+.
|
|
202
|
+
|
|
203
|
+
def add_alias(an_alias, context)
|
|
204
|
+
raise NotImplementedError
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
##
|
|
208
|
+
# HTML fragment reference for this method
|
|
209
|
+
|
|
210
|
+
def aref
|
|
211
|
+
type = singleton ? 'c' : 'i'
|
|
212
|
+
# % characters are not allowed in html names => dash instead
|
|
213
|
+
"#{aref_prefix}-#{type}-#{html_name}"
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
##
|
|
217
|
+
# Prefix for +aref+, defined by subclasses.
|
|
218
|
+
|
|
219
|
+
def aref_prefix
|
|
220
|
+
raise NotImplementedError
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
##
|
|
224
|
+
# Attempts to sanitize the content passed by the Ruby parser:
|
|
225
|
+
# remove outer parentheses, etc.
|
|
226
|
+
|
|
227
|
+
def block_params=(value)
|
|
228
|
+
# 'yield.to_s' or 'assert yield, msg'
|
|
229
|
+
return @block_params = '' if value =~ /^[\.,]/
|
|
230
|
+
|
|
231
|
+
# remove trailing 'if/unless ...'
|
|
232
|
+
return @block_params = '' if value =~ /^(if|unless)\s/
|
|
233
|
+
|
|
234
|
+
value = $1.strip if value =~ /^(.+)\s(if|unless)\s/
|
|
235
|
+
|
|
236
|
+
# outer parentheses
|
|
237
|
+
value = $1 if value =~ /^\s*\((.*)\)\s*$/
|
|
238
|
+
value = value.strip
|
|
239
|
+
|
|
240
|
+
# proc/lambda
|
|
241
|
+
return @block_params = $1 if value =~ /^(proc|lambda)(\s*\{|\sdo)/
|
|
242
|
+
|
|
243
|
+
# surrounding +...+ or [...]
|
|
244
|
+
value = $1.strip if value =~ /^\+(.*)\+$/
|
|
245
|
+
value = $1.strip if value =~ /^\[(.*)\]$/
|
|
246
|
+
|
|
247
|
+
return @block_params = '' if value.empty?
|
|
248
|
+
|
|
249
|
+
# global variable
|
|
250
|
+
return @block_params = 'str' if value =~ /^\$[&0-9]$/
|
|
251
|
+
|
|
252
|
+
# wipe out array/hash indices
|
|
253
|
+
value.gsub!(/(\w)\[[^\[]+\]/, '\1')
|
|
254
|
+
|
|
255
|
+
# remove @ from class/instance variables
|
|
256
|
+
value.gsub!(/@@?([a-z0-9_]+)/, '\1')
|
|
257
|
+
|
|
258
|
+
# method calls => method name
|
|
259
|
+
value.gsub!(/([A-Z:a-z0-9_]+)\.([a-z0-9_]+)(\s*\(\s*[a-z0-9_.,\s]*\s*\)\s*)?/) do
|
|
260
|
+
case $2
|
|
261
|
+
when 'to_s' then $1
|
|
262
|
+
when 'const_get' then 'const'
|
|
263
|
+
when 'new' then
|
|
264
|
+
$1.split('::').last. # ClassName => class_name
|
|
265
|
+
gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
|
|
266
|
+
gsub(/([a-z\d])([A-Z])/, '\1_\2').
|
|
267
|
+
downcase
|
|
268
|
+
else
|
|
269
|
+
$2
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
# class prefixes
|
|
274
|
+
value.gsub!(/[A-Za-z0-9_:]+::/, '')
|
|
275
|
+
|
|
276
|
+
# simple expressions
|
|
277
|
+
value = $1 if value =~ /^([a-z0-9_]+)\s*[-*+\/]/
|
|
278
|
+
|
|
279
|
+
@block_params = value.strip
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
##
|
|
283
|
+
# HTML id-friendly method/attribute name
|
|
284
|
+
|
|
285
|
+
def html_name
|
|
286
|
+
require 'cgi/escape'
|
|
287
|
+
require 'cgi/util' unless defined?(CGI::EscapeExt)
|
|
288
|
+
|
|
289
|
+
CGI.escape(@name.gsub('-', '-2D')).gsub('%', '-').sub(/^-/, '')
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
##
|
|
293
|
+
# Full method/attribute name including namespace
|
|
294
|
+
|
|
295
|
+
def full_name
|
|
296
|
+
@full_name ||= "#{parent_name}#{pretty_name}"
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
def inspect # :nodoc:
|
|
300
|
+
alias_for = @is_alias_for ? " (alias for #{@is_alias_for.name})" : nil
|
|
301
|
+
visibility = self.visibility
|
|
302
|
+
visibility = "forced #{visibility}" if force_documentation
|
|
303
|
+
"#<%s:0x%x %s (%s)%s>" % [
|
|
304
|
+
self.class, object_id,
|
|
305
|
+
full_name,
|
|
306
|
+
visibility,
|
|
307
|
+
alias_for,
|
|
308
|
+
]
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
##
|
|
312
|
+
# '::' for a class method/attribute, '#' for an instance method.
|
|
313
|
+
|
|
314
|
+
def name_prefix
|
|
315
|
+
@singleton ? '::' : '#'
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
##
|
|
319
|
+
# Method/attribute name with class/instance indicator
|
|
320
|
+
|
|
321
|
+
def pretty_name
|
|
322
|
+
"#{name_prefix}#{@name}"
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
##
|
|
326
|
+
# Type of method/attribute (class or instance)
|
|
327
|
+
|
|
328
|
+
def type
|
|
329
|
+
singleton ? 'class' : 'instance'
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
##
|
|
333
|
+
# Path to this method for use with HTML generator output.
|
|
334
|
+
|
|
335
|
+
def path
|
|
336
|
+
"#{@parent.path}##{aref}"
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
##
|
|
340
|
+
# Name of our parent with special handling for un-marshaled methods
|
|
341
|
+
|
|
342
|
+
def parent_name
|
|
343
|
+
@parent_name || super
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
def pretty_print(q) # :nodoc:
|
|
347
|
+
alias_for =
|
|
348
|
+
if @is_alias_for.respond_to? :name then
|
|
349
|
+
"alias for #{@is_alias_for.name}"
|
|
350
|
+
elsif Array === @is_alias_for then
|
|
351
|
+
"alias for #{@is_alias_for.last}"
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
q.group 2, "[#{self.class.name} #{full_name} #{visibility}", "]" do
|
|
355
|
+
if alias_for then
|
|
356
|
+
q.breakable
|
|
357
|
+
q.text alias_for
|
|
358
|
+
end
|
|
359
|
+
|
|
360
|
+
unless comment.empty? then
|
|
361
|
+
q.breakable
|
|
362
|
+
q.text "comment:"
|
|
363
|
+
q.breakable
|
|
364
|
+
q.pp @comment
|
|
365
|
+
end
|
|
366
|
+
end
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
##
|
|
370
|
+
# Used by RDoc::Generator::JsonIndex to create a record for the search
|
|
371
|
+
# engine.
|
|
372
|
+
#
|
|
373
|
+
# TODO: Remove this method after dropping the darkfish theme and JsonIndex generator.
|
|
374
|
+
# Use #search_snippet instead for getting documentation snippets.
|
|
375
|
+
|
|
376
|
+
def search_record
|
|
377
|
+
[
|
|
378
|
+
@name,
|
|
379
|
+
full_name,
|
|
380
|
+
@name,
|
|
381
|
+
@parent.full_name,
|
|
382
|
+
path,
|
|
383
|
+
params,
|
|
384
|
+
search_snippet,
|
|
385
|
+
]
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
##
|
|
389
|
+
# Returns an HTML snippet of the comment for search results.
|
|
390
|
+
|
|
391
|
+
def search_snippet
|
|
392
|
+
return '' if @comment.empty?
|
|
393
|
+
|
|
394
|
+
snippet(@comment)
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
def to_s # :nodoc:
|
|
398
|
+
if @is_alias_for
|
|
399
|
+
"#{self.class.name}: #{full_name} -> #{is_alias_for}"
|
|
400
|
+
else
|
|
401
|
+
"#{self.class.name}: #{full_name}"
|
|
402
|
+
end
|
|
403
|
+
end
|
|
404
|
+
|
|
405
|
+
def name_ord_range # :nodoc:
|
|
406
|
+
case name.ord
|
|
407
|
+
when 0..64 # anything below "A"
|
|
408
|
+
1
|
|
409
|
+
when 91..96 # the symbols between "Z" and "a"
|
|
410
|
+
2
|
|
411
|
+
when 123..126 # 7-bit symbols above "z": "{", "|", "}", "~"
|
|
412
|
+
3
|
|
413
|
+
else # everythig else can be sorted as normal
|
|
414
|
+
4
|
|
415
|
+
end
|
|
416
|
+
end
|
|
417
|
+
end
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
##
|
|
3
|
+
# A Mixin adds features from a module into another context. RDoc::Include and
|
|
4
|
+
# RDoc::Extend are both mixins.
|
|
5
|
+
|
|
6
|
+
class RDoc::Mixin < RDoc::CodeObject
|
|
7
|
+
|
|
8
|
+
##
|
|
9
|
+
# Name of included module
|
|
10
|
+
|
|
11
|
+
attr_accessor :name
|
|
12
|
+
|
|
13
|
+
##
|
|
14
|
+
# Creates a new Mixin for +name+ with +comment+
|
|
15
|
+
|
|
16
|
+
def initialize(name, comment)
|
|
17
|
+
super()
|
|
18
|
+
@name = name
|
|
19
|
+
self.comment = comment
|
|
20
|
+
@module = nil # cache for module if found
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
##
|
|
24
|
+
# Mixins are sorted by name
|
|
25
|
+
|
|
26
|
+
def <=>(other)
|
|
27
|
+
return unless self.class === other
|
|
28
|
+
|
|
29
|
+
name <=> other.name
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def ==(other) # :nodoc:
|
|
33
|
+
self.class === other and @name == other.name
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
alias eql? == # :nodoc:
|
|
37
|
+
|
|
38
|
+
##
|
|
39
|
+
# Full name based on #module
|
|
40
|
+
|
|
41
|
+
def full_name
|
|
42
|
+
m = self.module
|
|
43
|
+
RDoc::ClassModule === m ? m.full_name : @name
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def hash # :nodoc:
|
|
47
|
+
[@name, self.module].hash
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def inspect # :nodoc:
|
|
51
|
+
"#<%s:0x%x %s.%s %s>" % [
|
|
52
|
+
self.class,
|
|
53
|
+
object_id,
|
|
54
|
+
parent_name, self.class.name.downcase, @name,
|
|
55
|
+
]
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
##
|
|
59
|
+
# Attempts to locate the included module object. Returns the name if not
|
|
60
|
+
# known.
|
|
61
|
+
#
|
|
62
|
+
# The scoping rules of Ruby to resolve the name of an included module are:
|
|
63
|
+
# - first look into the children of the current context;
|
|
64
|
+
# - if not found, look into the children of included modules,
|
|
65
|
+
# in reverse inclusion order;
|
|
66
|
+
# - if still not found, go up the hierarchy of names.
|
|
67
|
+
#
|
|
68
|
+
# This method has <code>O(n!)</code> behavior when the module calling
|
|
69
|
+
# include is referencing nonexistent modules. Avoid calling #module until
|
|
70
|
+
# after all the files are parsed. This behavior is due to ruby's constant
|
|
71
|
+
# lookup behavior.
|
|
72
|
+
#
|
|
73
|
+
# As of the beginning of October, 2011, no gem includes nonexistent modules.
|
|
74
|
+
#
|
|
75
|
+
# The Ruby parser passes an already-resolved full-path +name+, so most of this
|
|
76
|
+
# logic only runs for the C parser, which passes the unresolved local name.
|
|
77
|
+
|
|
78
|
+
def module
|
|
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]
|
|
95
|
+
return @module if @module
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# go up the hierarchy of names
|
|
99
|
+
up = parent.parent
|
|
100
|
+
while up
|
|
101
|
+
full_name = up.child_name(@name)
|
|
102
|
+
@module = @store.modules_hash[full_name]
|
|
103
|
+
return @module if @module
|
|
104
|
+
up = up.parent
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
@name
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
##
|
|
111
|
+
# Sets the store for this class or module and its contained code objects.
|
|
112
|
+
|
|
113
|
+
def store=(store)
|
|
114
|
+
super
|
|
115
|
+
|
|
116
|
+
@file = @store.add_file @file.full_name if @file
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def to_s # :nodoc:
|
|
120
|
+
"#{self.class.name.downcase} #@name in: #{parent}"
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
end
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
##
|
|
3
|
+
# A normal class, neither singleton nor anonymous
|
|
4
|
+
|
|
5
|
+
class RDoc::NormalClass < RDoc::ClassModule
|
|
6
|
+
|
|
7
|
+
##
|
|
8
|
+
# The ancestors of this class including modules. Unlike Module#ancestors,
|
|
9
|
+
# this class is not included in the result. The result will contain both
|
|
10
|
+
# RDoc::ClassModules and Strings.
|
|
11
|
+
|
|
12
|
+
def ancestors
|
|
13
|
+
if String === superclass then
|
|
14
|
+
super << superclass
|
|
15
|
+
elsif superclass then
|
|
16
|
+
ancestors = super
|
|
17
|
+
ancestors << superclass
|
|
18
|
+
ancestors.concat superclass.ancestors
|
|
19
|
+
else
|
|
20
|
+
super
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def aref_prefix # :nodoc:
|
|
25
|
+
'class'
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
##
|
|
29
|
+
# The definition of this class, <tt>class MyClassName</tt>
|
|
30
|
+
|
|
31
|
+
def definition
|
|
32
|
+
"class #{full_name}"
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def direct_ancestors
|
|
36
|
+
superclass ? super + [superclass] : super
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def inspect # :nodoc:
|
|
40
|
+
superclass = @superclass ? " < #{@superclass}" : nil
|
|
41
|
+
"<%s:0x%x class %s%s includes: %p extends: %p attributes: %p methods: %p aliases: %p>" % [
|
|
42
|
+
self.class, object_id,
|
|
43
|
+
full_name, superclass, @includes, @extends, @attributes, @method_list, @aliases
|
|
44
|
+
]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def to_s # :nodoc:
|
|
48
|
+
display = "#{self.class.name} #{self.full_name}"
|
|
49
|
+
if superclass
|
|
50
|
+
display += ' < ' + (superclass.is_a?(String) ? superclass : superclass.full_name)
|
|
51
|
+
end
|
|
52
|
+
display += ' -> ' + is_alias_for.to_s if is_alias_for
|
|
53
|
+
display
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def pretty_print(q) # :nodoc:
|
|
57
|
+
superclass = @superclass ? " < #{@superclass}" : nil
|
|
58
|
+
|
|
59
|
+
q.group 2, "[class #{full_name}#{superclass}", "]" do
|
|
60
|
+
q.breakable
|
|
61
|
+
q.text "includes:"
|
|
62
|
+
q.breakable
|
|
63
|
+
q.seplist @includes do |inc| q.pp inc end
|
|
64
|
+
|
|
65
|
+
q.breakable
|
|
66
|
+
q.text "constants:"
|
|
67
|
+
q.breakable
|
|
68
|
+
q.seplist @constants do |const| q.pp const end
|
|
69
|
+
|
|
70
|
+
q.breakable
|
|
71
|
+
q.text "attributes:"
|
|
72
|
+
q.breakable
|
|
73
|
+
q.seplist @attributes do |attr| q.pp attr end
|
|
74
|
+
|
|
75
|
+
q.breakable
|
|
76
|
+
q.text "methods:"
|
|
77
|
+
q.breakable
|
|
78
|
+
q.seplist @method_list do |meth| q.pp meth end
|
|
79
|
+
|
|
80
|
+
q.breakable
|
|
81
|
+
q.text "aliases:"
|
|
82
|
+
q.breakable
|
|
83
|
+
q.seplist @aliases do |aliaz| q.pp aliaz end
|
|
84
|
+
|
|
85
|
+
q.breakable
|
|
86
|
+
q.text "comment:"
|
|
87
|
+
q.breakable
|
|
88
|
+
q.pp comment
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
##
|
|
3
|
+
# A normal module, like NormalClass
|
|
4
|
+
|
|
5
|
+
class RDoc::NormalModule < RDoc::ClassModule
|
|
6
|
+
|
|
7
|
+
def aref_prefix # :nodoc:
|
|
8
|
+
'module'
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def inspect # :nodoc:
|
|
12
|
+
"#<%s:0x%x module %s includes: %p extends: %p attributes: %p methods: %p aliases: %p>" % [
|
|
13
|
+
self.class, object_id,
|
|
14
|
+
full_name, @includes, @extends, @attributes, @method_list, @aliases
|
|
15
|
+
]
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
##
|
|
19
|
+
# The definition of this module, <tt>module MyModuleName</tt>
|
|
20
|
+
|
|
21
|
+
def definition
|
|
22
|
+
"module #{full_name}"
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
##
|
|
26
|
+
# This is a module, returns true
|
|
27
|
+
|
|
28
|
+
def module?
|
|
29
|
+
true
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def pretty_print(q) # :nodoc:
|
|
33
|
+
q.group 2, "[module #{full_name}:", "]" do
|
|
34
|
+
q.breakable
|
|
35
|
+
q.text "includes:"
|
|
36
|
+
q.breakable
|
|
37
|
+
q.seplist @includes do |inc| q.pp inc end
|
|
38
|
+
q.breakable
|
|
39
|
+
|
|
40
|
+
q.breakable
|
|
41
|
+
q.text "constants:"
|
|
42
|
+
q.breakable
|
|
43
|
+
q.seplist @constants do |const| q.pp const end
|
|
44
|
+
|
|
45
|
+
q.text "attributes:"
|
|
46
|
+
q.breakable
|
|
47
|
+
q.seplist @attributes do |attr| q.pp attr end
|
|
48
|
+
q.breakable
|
|
49
|
+
|
|
50
|
+
q.text "methods:"
|
|
51
|
+
q.breakable
|
|
52
|
+
q.seplist @method_list do |meth| q.pp meth end
|
|
53
|
+
q.breakable
|
|
54
|
+
|
|
55
|
+
q.text "aliases:"
|
|
56
|
+
q.breakable
|
|
57
|
+
q.seplist @aliases do |aliaz| q.pp aliaz end
|
|
58
|
+
q.breakable
|
|
59
|
+
|
|
60
|
+
q.text "comment:"
|
|
61
|
+
q.breakable
|
|
62
|
+
q.pp comment
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
##
|
|
67
|
+
# Modules don't have one, raises NoMethodError
|
|
68
|
+
|
|
69
|
+
def superclass
|
|
70
|
+
raise NoMethodError, "#{full_name} is a module"
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
end
|