mega-max-hub 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/mega-max-hub.gemspec +11 -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
- metadata +256 -0
data/rdoc-8.0.0/exe/rdoc
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
#
|
|
3
|
+
# RDoc: Documentation tool for source code
|
|
4
|
+
# (see lib/rdoc/rdoc.rb for more information)
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2003 Dave Thomas
|
|
7
|
+
# Released under the same terms as Ruby
|
|
8
|
+
|
|
9
|
+
begin
|
|
10
|
+
gem 'rdoc'
|
|
11
|
+
rescue NameError => e # --disable-gems
|
|
12
|
+
raise unless e.name == :gem
|
|
13
|
+
rescue Gem::LoadError
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
require 'rdoc/rdoc'
|
|
17
|
+
|
|
18
|
+
begin
|
|
19
|
+
r = RDoc::RDoc.new
|
|
20
|
+
r.document ARGV
|
|
21
|
+
rescue Errno::ENOSPC
|
|
22
|
+
$stderr.puts 'Ran out of space creating documentation'
|
|
23
|
+
$stderr.puts
|
|
24
|
+
$stderr.puts 'Please free up some space and try again'
|
|
25
|
+
rescue SystemExit
|
|
26
|
+
raise
|
|
27
|
+
rescue Exception => e
|
|
28
|
+
if $DEBUG_RDOC then
|
|
29
|
+
$stderr.puts e.message
|
|
30
|
+
$stderr.puts "#{e.backtrace.join "\n\t"}"
|
|
31
|
+
$stderr.puts
|
|
32
|
+
elsif Interrupt === e then
|
|
33
|
+
$stderr.puts
|
|
34
|
+
$stderr.puts 'Interrupted'
|
|
35
|
+
else
|
|
36
|
+
$stderr.puts "uh-oh! RDoc had a problem:"
|
|
37
|
+
$stderr.puts e.message
|
|
38
|
+
$stderr.puts
|
|
39
|
+
$stderr.puts "run with --debug for full backtrace"
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
exit 1
|
|
43
|
+
end
|
data/rdoc-8.0.0/exe/ri
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
##
|
|
3
|
+
# Represent an alias, which is an old_name/new_name pair associated with a
|
|
4
|
+
# particular context
|
|
5
|
+
#--
|
|
6
|
+
# TODO implement Alias as a proxy to a method/attribute, inheriting from
|
|
7
|
+
# MethodAttr
|
|
8
|
+
|
|
9
|
+
class RDoc::Alias < RDoc::CodeObject
|
|
10
|
+
|
|
11
|
+
##
|
|
12
|
+
# Aliased method's name
|
|
13
|
+
|
|
14
|
+
attr_reader :new_name
|
|
15
|
+
|
|
16
|
+
alias name new_name
|
|
17
|
+
|
|
18
|
+
##
|
|
19
|
+
# Aliasee method's name
|
|
20
|
+
|
|
21
|
+
attr_reader :old_name
|
|
22
|
+
|
|
23
|
+
##
|
|
24
|
+
# Is this an alias declared in a singleton context?
|
|
25
|
+
|
|
26
|
+
attr_reader :singleton
|
|
27
|
+
|
|
28
|
+
##
|
|
29
|
+
# Creates a new Alias that aliases +old_name+
|
|
30
|
+
# to +new_name+, has +comment+ and is a +singleton+ context.
|
|
31
|
+
|
|
32
|
+
def initialize(old_name, new_name, comment, singleton: false)
|
|
33
|
+
super()
|
|
34
|
+
|
|
35
|
+
@singleton = singleton
|
|
36
|
+
@old_name = old_name
|
|
37
|
+
@new_name = new_name
|
|
38
|
+
self.comment = comment
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
##
|
|
42
|
+
# Order by #singleton then #new_name
|
|
43
|
+
|
|
44
|
+
def <=>(other)
|
|
45
|
+
[@singleton ? 0 : 1, new_name] <=> [other.singleton ? 0 : 1, other.new_name]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
##
|
|
49
|
+
# HTML fragment reference for this alias
|
|
50
|
+
|
|
51
|
+
def aref
|
|
52
|
+
type = singleton ? 'c' : 'i'
|
|
53
|
+
"#alias-#{type}-#{html_name}"
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
##
|
|
57
|
+
# HTML id-friendly version of +#new_name+.
|
|
58
|
+
|
|
59
|
+
def html_name
|
|
60
|
+
CGI.escape(@new_name.gsub('-', '-2D')).gsub('%', '-').sub(/^-/, '')
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def inspect # :nodoc:
|
|
64
|
+
parent_name = parent ? parent.name : '(unknown)'
|
|
65
|
+
"#<%s:0x%x %s.alias_method %s, %s>" % [
|
|
66
|
+
self.class, object_id,
|
|
67
|
+
parent_name, @old_name, @new_name,
|
|
68
|
+
]
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
##
|
|
72
|
+
# '::' for the alias of a singleton method/attribute, '#' for instance-level.
|
|
73
|
+
|
|
74
|
+
def name_prefix
|
|
75
|
+
singleton ? '::' : '#'
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
##
|
|
79
|
+
# Old name with prefix '::' or '#'.
|
|
80
|
+
|
|
81
|
+
def pretty_old_name
|
|
82
|
+
"#{singleton ? '::' : '#'}#{@old_name}"
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
##
|
|
86
|
+
# New name with prefix '::' or '#'.
|
|
87
|
+
|
|
88
|
+
def pretty_new_name
|
|
89
|
+
"#{singleton ? '::' : '#'}#{@new_name}"
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
alias pretty_name pretty_new_name
|
|
93
|
+
|
|
94
|
+
def to_s # :nodoc:
|
|
95
|
+
"alias: #{self.new_name} -> #{self.pretty_old_name} in: #{parent}"
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
end
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
##
|
|
3
|
+
# AnyMethod is the base class for objects representing methods
|
|
4
|
+
|
|
5
|
+
class RDoc::AnyMethod < RDoc::MethodAttr
|
|
6
|
+
|
|
7
|
+
##
|
|
8
|
+
# 2::
|
|
9
|
+
# RDoc 4
|
|
10
|
+
# Added calls_super
|
|
11
|
+
# Added parent name and class
|
|
12
|
+
# Added section title
|
|
13
|
+
# 3::
|
|
14
|
+
# RDoc 4.1
|
|
15
|
+
# Added is_alias_for
|
|
16
|
+
# 4::
|
|
17
|
+
# Added type_signature_lines (serialized as joined string)
|
|
18
|
+
|
|
19
|
+
MARSHAL_VERSION = 4 # :nodoc:
|
|
20
|
+
|
|
21
|
+
##
|
|
22
|
+
# Don't rename \#initialize to \::new
|
|
23
|
+
|
|
24
|
+
attr_accessor :dont_rename_initialize
|
|
25
|
+
|
|
26
|
+
##
|
|
27
|
+
# The C function that implements this method (if it was defined in a C file)
|
|
28
|
+
|
|
29
|
+
attr_accessor :c_function
|
|
30
|
+
|
|
31
|
+
# The section title of the method (if defined in a C file via +:category:+)
|
|
32
|
+
attr_accessor :section_title
|
|
33
|
+
|
|
34
|
+
##
|
|
35
|
+
# If true this method uses +super+ to call a superclass version
|
|
36
|
+
|
|
37
|
+
attr_accessor :calls_super
|
|
38
|
+
|
|
39
|
+
include RDoc::TokenStream
|
|
40
|
+
|
|
41
|
+
##
|
|
42
|
+
# Creates a new AnyMethod with name +name+
|
|
43
|
+
|
|
44
|
+
def initialize(name, singleton: false)
|
|
45
|
+
super(name, singleton: singleton)
|
|
46
|
+
|
|
47
|
+
@c_function = nil
|
|
48
|
+
@dont_rename_initialize = false
|
|
49
|
+
@token_stream = nil
|
|
50
|
+
@calls_super = false
|
|
51
|
+
@superclass_method = nil
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
##
|
|
55
|
+
# Adds +an_alias+ as an alias for this method in +context+.
|
|
56
|
+
|
|
57
|
+
def add_alias(an_alias, context = nil)
|
|
58
|
+
method = self.class.new an_alias.new_name, singleton: singleton
|
|
59
|
+
|
|
60
|
+
method.record_location an_alias.file
|
|
61
|
+
method.params = self.params
|
|
62
|
+
method.visibility = self.visibility
|
|
63
|
+
method.comment = an_alias.comment
|
|
64
|
+
method.is_alias_for = self
|
|
65
|
+
method.type_signature_lines = self.type_signature_lines
|
|
66
|
+
@aliases << method
|
|
67
|
+
context.add_method method if context
|
|
68
|
+
method
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
##
|
|
72
|
+
# Prefix for +aref+ is 'method'.
|
|
73
|
+
|
|
74
|
+
def aref_prefix
|
|
75
|
+
'method'
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
##
|
|
79
|
+
# The call_seq or the param_seq with method name, if there is no call_seq.
|
|
80
|
+
#
|
|
81
|
+
# Use this for displaying a method's argument lists.
|
|
82
|
+
|
|
83
|
+
def arglists
|
|
84
|
+
if @call_seq then
|
|
85
|
+
@call_seq
|
|
86
|
+
elsif @params then
|
|
87
|
+
"#{name}#{param_seq}"
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
##
|
|
92
|
+
# Different ways to call this method
|
|
93
|
+
|
|
94
|
+
def call_seq
|
|
95
|
+
unless call_seq = _call_seq
|
|
96
|
+
call_seq = is_alias_for._call_seq if is_alias_for
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
return unless call_seq
|
|
100
|
+
|
|
101
|
+
deduplicate_call_seq(call_seq)
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
##
|
|
105
|
+
# Sets the different ways you can call this method. If an empty +call_seq+
|
|
106
|
+
# is given nil is assumed.
|
|
107
|
+
#
|
|
108
|
+
# See also #param_seq
|
|
109
|
+
|
|
110
|
+
def call_seq=(call_seq)
|
|
111
|
+
return if call_seq.nil? || call_seq.empty?
|
|
112
|
+
|
|
113
|
+
@call_seq = call_seq
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
##
|
|
117
|
+
# Whether the method has a call-seq.
|
|
118
|
+
|
|
119
|
+
def has_call_seq?
|
|
120
|
+
!!(@call_seq || is_alias_for&._call_seq)
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
##
|
|
124
|
+
# Loads is_alias_for from the internal name. Returns nil if the alias
|
|
125
|
+
# cannot be found.
|
|
126
|
+
|
|
127
|
+
def is_alias_for # :nodoc:
|
|
128
|
+
case @is_alias_for
|
|
129
|
+
when RDoc::MethodAttr then
|
|
130
|
+
@is_alias_for
|
|
131
|
+
when Array then
|
|
132
|
+
return nil unless @store
|
|
133
|
+
|
|
134
|
+
klass_name, singleton, method_name = @is_alias_for
|
|
135
|
+
|
|
136
|
+
return nil unless klass = @store.find_class_or_module(klass_name)
|
|
137
|
+
|
|
138
|
+
@is_alias_for = klass.find_method method_name, singleton
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
##
|
|
143
|
+
# Dumps this AnyMethod for use by ri. See also #marshal_load
|
|
144
|
+
|
|
145
|
+
def marshal_dump
|
|
146
|
+
aliases = @aliases.map do |a|
|
|
147
|
+
[a.name, parse(a.comment)]
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
is_alias_for = [
|
|
151
|
+
@is_alias_for.parent.full_name,
|
|
152
|
+
@is_alias_for.singleton,
|
|
153
|
+
@is_alias_for.name
|
|
154
|
+
] if @is_alias_for
|
|
155
|
+
|
|
156
|
+
[ MARSHAL_VERSION,
|
|
157
|
+
@name,
|
|
158
|
+
full_name,
|
|
159
|
+
@singleton,
|
|
160
|
+
@visibility,
|
|
161
|
+
parse(@comment),
|
|
162
|
+
@call_seq,
|
|
163
|
+
@block_params,
|
|
164
|
+
aliases,
|
|
165
|
+
@params,
|
|
166
|
+
@file.relative_name,
|
|
167
|
+
@calls_super,
|
|
168
|
+
@parent.name,
|
|
169
|
+
@parent.class,
|
|
170
|
+
@section.title,
|
|
171
|
+
is_alias_for,
|
|
172
|
+
@type_signature_lines&.join("\n"),
|
|
173
|
+
]
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
##
|
|
177
|
+
# Loads this AnyMethod from +array+. For a loaded AnyMethod the following
|
|
178
|
+
# methods will return cached values:
|
|
179
|
+
#
|
|
180
|
+
# * #full_name
|
|
181
|
+
# * #parent_name
|
|
182
|
+
|
|
183
|
+
def marshal_load(array)
|
|
184
|
+
initialize_visibility
|
|
185
|
+
|
|
186
|
+
@dont_rename_initialize = nil
|
|
187
|
+
@token_stream = nil
|
|
188
|
+
@aliases = []
|
|
189
|
+
@parent = nil
|
|
190
|
+
@parent_name = nil
|
|
191
|
+
@parent_class = nil
|
|
192
|
+
@section = nil
|
|
193
|
+
@file = nil
|
|
194
|
+
|
|
195
|
+
version = array[0]
|
|
196
|
+
@name = array[1]
|
|
197
|
+
@full_name = array[2]
|
|
198
|
+
@singleton = array[3]
|
|
199
|
+
@visibility = array[4]
|
|
200
|
+
@comment = RDoc::Comment.from_document array[5]
|
|
201
|
+
@call_seq = array[6]
|
|
202
|
+
@block_params = array[7]
|
|
203
|
+
# 8 handled below
|
|
204
|
+
@params = array[9]
|
|
205
|
+
# 10 handled below
|
|
206
|
+
@calls_super = array[11]
|
|
207
|
+
@parent_name = array[12]
|
|
208
|
+
@parent_title = array[13]
|
|
209
|
+
@section_title = array[14]
|
|
210
|
+
@is_alias_for = array[15]
|
|
211
|
+
@type_signature_lines = array[16]&.split("\n")
|
|
212
|
+
|
|
213
|
+
array[8].each do |new_name, document|
|
|
214
|
+
add_alias RDoc::Alias.new(@name, new_name, RDoc::Comment.from_document(document), singleton: @singleton)
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
@parent_name ||= if @full_name =~ /#/ then
|
|
218
|
+
$`
|
|
219
|
+
else
|
|
220
|
+
name = @full_name.split('::')
|
|
221
|
+
name.pop
|
|
222
|
+
name.join '::'
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
@file = RDoc::TopLevel.new array[10] if version > 0
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
##
|
|
229
|
+
# Method name
|
|
230
|
+
#
|
|
231
|
+
# If the method has no assigned name, it extracts it from #call_seq.
|
|
232
|
+
|
|
233
|
+
def name
|
|
234
|
+
return @name if @name
|
|
235
|
+
|
|
236
|
+
@name =
|
|
237
|
+
@call_seq[/^.*?\.(\w+)/, 1] ||
|
|
238
|
+
@call_seq[/^.*?(\w+)/, 1] ||
|
|
239
|
+
@call_seq if @call_seq
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
##
|
|
243
|
+
# A list of this method's method and yield parameters. +call-seq+ params
|
|
244
|
+
# are preferred over parsed method and block params.
|
|
245
|
+
|
|
246
|
+
def param_list
|
|
247
|
+
if @call_seq then
|
|
248
|
+
params = @call_seq.split("\n").last
|
|
249
|
+
params = params.sub(/.*?\((.*)\)/, '\1')
|
|
250
|
+
params = params.sub(/(\{|do)\s*\|([^|]*)\|.*/, ',\2')
|
|
251
|
+
elsif @params then
|
|
252
|
+
params = @params.sub(/\((.*)\)/, '\1')
|
|
253
|
+
|
|
254
|
+
params << ",#{@block_params}" if @block_params
|
|
255
|
+
elsif @block_params then
|
|
256
|
+
params = @block_params
|
|
257
|
+
else
|
|
258
|
+
return []
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
if @block_params then
|
|
262
|
+
# If this method has explicit block parameters, remove any explicit
|
|
263
|
+
# &block
|
|
264
|
+
params = params.sub(/,?\s*&\w+/, '')
|
|
265
|
+
else
|
|
266
|
+
params = params.sub(/\&(\w+)/, '\1')
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
params = params.gsub(/\s+/, '').split(',').reject(&:empty?)
|
|
270
|
+
|
|
271
|
+
params.map { |param| param.sub(/=.*/, '') }
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
##
|
|
275
|
+
# Pretty parameter list for this method. If the method's parameters were
|
|
276
|
+
# given by +call-seq+ it is preferred over the parsed values.
|
|
277
|
+
|
|
278
|
+
def param_seq
|
|
279
|
+
if @call_seq then
|
|
280
|
+
params = @call_seq.split("\n").last
|
|
281
|
+
params = params.sub(/[^( ]+/, '')
|
|
282
|
+
params = params.sub(/(\|[^|]+\|)\s*\.\.\.\s*(end|\})/, '\1 \2')
|
|
283
|
+
elsif @params then
|
|
284
|
+
params = @params.gsub(/\s*\#.*/, '')
|
|
285
|
+
params = params.tr_s("\n ", " ")
|
|
286
|
+
params = "(#{params})" unless params[0] == ?(
|
|
287
|
+
else
|
|
288
|
+
params = ''
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
if @block_params then
|
|
292
|
+
# If this method has explicit block parameters, remove any explicit
|
|
293
|
+
# &block
|
|
294
|
+
params = params.sub(/,?\s*&\w+/, '')
|
|
295
|
+
|
|
296
|
+
block = @block_params.tr_s("\n ", " ")
|
|
297
|
+
if block[0] == ?(
|
|
298
|
+
block = block.sub(/^\(/, '').sub(/\)/, '')
|
|
299
|
+
end
|
|
300
|
+
params << " { |#{block}| ... }"
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
params
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
##
|
|
307
|
+
# Whether to skip the method description, true for methods that have
|
|
308
|
+
# aliases with a call-seq that doesn't include the method name.
|
|
309
|
+
|
|
310
|
+
def skip_description?
|
|
311
|
+
has_call_seq? && call_seq.nil? && !!(is_alias_for || !aliases.empty?)
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
##
|
|
315
|
+
# Sets the store for this method and its referenced code objects.
|
|
316
|
+
|
|
317
|
+
def store=(store)
|
|
318
|
+
super
|
|
319
|
+
|
|
320
|
+
@file = @store.add_file @file.full_name if @file
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
##
|
|
324
|
+
# For methods that +super+, find the superclass method that would be called.
|
|
325
|
+
|
|
326
|
+
def superclass_method
|
|
327
|
+
return unless @calls_super
|
|
328
|
+
return @superclass_method if @superclass_method
|
|
329
|
+
|
|
330
|
+
parent.each_ancestor do |ancestor|
|
|
331
|
+
if method = ancestor.method_list.find { |m| m.name == @name } then
|
|
332
|
+
@superclass_method = method
|
|
333
|
+
break
|
|
334
|
+
end
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
@superclass_method
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
protected
|
|
341
|
+
|
|
342
|
+
##
|
|
343
|
+
# call_seq without deduplication and alias lookup.
|
|
344
|
+
|
|
345
|
+
def _call_seq
|
|
346
|
+
@call_seq if defined?(@call_seq) && @call_seq
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
private
|
|
350
|
+
|
|
351
|
+
##
|
|
352
|
+
# call_seq with alias examples information removed, if this
|
|
353
|
+
# method is an alias method.
|
|
354
|
+
|
|
355
|
+
def deduplicate_call_seq(call_seq)
|
|
356
|
+
return call_seq unless is_alias_for || !aliases.empty?
|
|
357
|
+
|
|
358
|
+
method_name = self.name
|
|
359
|
+
|
|
360
|
+
entries = call_seq.split "\n"
|
|
361
|
+
|
|
362
|
+
ignore = aliases.map(&:name)
|
|
363
|
+
if is_alias_for
|
|
364
|
+
ignore << is_alias_for.name
|
|
365
|
+
ignore.concat is_alias_for.aliases.map(&:name)
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
ignore.delete(method_name)
|
|
369
|
+
ignore_bracket_methods, ignore_other_methods = ignore.partition {|i| i.start_with?('[') }
|
|
370
|
+
|
|
371
|
+
if ignore_other_methods.any?
|
|
372
|
+
ignore_union = Regexp.union(ignore_other_methods)
|
|
373
|
+
entries.reject! do |entry|
|
|
374
|
+
/\A(?:\w*\.)?#{ignore_union}(?:[(\s]|\z)/.match?(entry) ||
|
|
375
|
+
/\s#{ignore_union}\s/.match?(entry)
|
|
376
|
+
end
|
|
377
|
+
end
|
|
378
|
+
if ignore_bracket_methods.any?
|
|
379
|
+
entries.reject! do |entry|
|
|
380
|
+
# Ignore `receiver[arg] -> return_type` `[](arg)` `[]`
|
|
381
|
+
/\A\w*\[.*?\](?:[(\s]|\z)/.match?(entry)
|
|
382
|
+
end
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
entries.empty? ? nil : entries.join("\n")
|
|
386
|
+
end
|
|
387
|
+
end
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
##
|
|
3
|
+
# An attribute created by \#attr, \#attr_reader, \#attr_writer or
|
|
4
|
+
# \#attr_accessor
|
|
5
|
+
|
|
6
|
+
class RDoc::Attr < RDoc::MethodAttr
|
|
7
|
+
|
|
8
|
+
##
|
|
9
|
+
# 3::
|
|
10
|
+
# RDoc 4
|
|
11
|
+
# Added parent name and class
|
|
12
|
+
# Added section title
|
|
13
|
+
# 4::
|
|
14
|
+
# Added type_signature_lines (serialized as joined string)
|
|
15
|
+
|
|
16
|
+
MARSHAL_VERSION = 4 # :nodoc:
|
|
17
|
+
|
|
18
|
+
##
|
|
19
|
+
# Is the attribute readable ('R'), writable ('W') or both ('RW')?
|
|
20
|
+
|
|
21
|
+
attr_accessor :rw
|
|
22
|
+
|
|
23
|
+
##
|
|
24
|
+
# Creates a new Attr with +name+, read/write status +rw+ and
|
|
25
|
+
# +comment+. +singleton+ marks this as a class attribute.
|
|
26
|
+
|
|
27
|
+
def initialize(name, rw, comment, singleton: false)
|
|
28
|
+
super(name, singleton: singleton)
|
|
29
|
+
|
|
30
|
+
@rw = rw
|
|
31
|
+
self.comment = comment
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
##
|
|
35
|
+
# Attributes are equal when their names, singleton and rw are identical
|
|
36
|
+
|
|
37
|
+
def ==(other)
|
|
38
|
+
self.class == other.class and
|
|
39
|
+
self.name == other.name and
|
|
40
|
+
self.rw == other.rw and
|
|
41
|
+
self.singleton == other.singleton
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
##
|
|
45
|
+
# Add +an_alias+ as an attribute in +context+.
|
|
46
|
+
|
|
47
|
+
def add_alias(an_alias, context)
|
|
48
|
+
access_type = an_alias.new_name.end_with?('=') ? 'W' : 'R'
|
|
49
|
+
new_attr = self.class.new(an_alias.new_name, access_type, comment, singleton: singleton)
|
|
50
|
+
new_attr.record_location an_alias.file
|
|
51
|
+
new_attr.visibility = self.visibility
|
|
52
|
+
new_attr.is_alias_for = self
|
|
53
|
+
new_attr.type_signature_lines = self.type_signature_lines
|
|
54
|
+
@aliases << new_attr
|
|
55
|
+
context.add_attribute new_attr
|
|
56
|
+
new_attr
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
##
|
|
60
|
+
# The #aref prefix for attributes
|
|
61
|
+
|
|
62
|
+
def aref_prefix
|
|
63
|
+
'attribute'
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
##
|
|
67
|
+
# Attributes never call super. See RDoc::AnyMethod#calls_super
|
|
68
|
+
#
|
|
69
|
+
# An RDoc::Attr can show up in the method list in some situations (see
|
|
70
|
+
# Gem::ConfigFile)
|
|
71
|
+
|
|
72
|
+
def calls_super # :nodoc:
|
|
73
|
+
false
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
##
|
|
77
|
+
# Returns attr_reader, attr_writer or attr_accessor as appropriate.
|
|
78
|
+
|
|
79
|
+
def definition
|
|
80
|
+
case @rw
|
|
81
|
+
when 'RW' then 'attr_accessor'
|
|
82
|
+
when 'R' then 'attr_reader'
|
|
83
|
+
when 'W' then 'attr_writer'
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def inspect # :nodoc:
|
|
88
|
+
alias_for = @is_alias_for ? " (alias for #{@is_alias_for.name})" : nil
|
|
89
|
+
visibility = self.visibility
|
|
90
|
+
visibility = "forced #{visibility}" if force_documentation
|
|
91
|
+
"#<%s:0x%x %s %s (%s)%s>" % [
|
|
92
|
+
self.class, object_id,
|
|
93
|
+
full_name,
|
|
94
|
+
rw,
|
|
95
|
+
visibility,
|
|
96
|
+
alias_for,
|
|
97
|
+
]
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
##
|
|
101
|
+
# Dumps this Attr for use by ri. See also #marshal_load
|
|
102
|
+
|
|
103
|
+
def marshal_dump
|
|
104
|
+
[ MARSHAL_VERSION,
|
|
105
|
+
@name,
|
|
106
|
+
full_name,
|
|
107
|
+
@rw,
|
|
108
|
+
@visibility,
|
|
109
|
+
parse(@comment),
|
|
110
|
+
singleton,
|
|
111
|
+
@file.relative_name,
|
|
112
|
+
@parent.full_name,
|
|
113
|
+
@parent.class,
|
|
114
|
+
@section.title,
|
|
115
|
+
@type_signature_lines&.join("\n"),
|
|
116
|
+
]
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
##
|
|
120
|
+
# Loads this Attr from +array+. For a loaded Attr the following
|
|
121
|
+
# methods will return cached values:
|
|
122
|
+
#
|
|
123
|
+
# * #full_name
|
|
124
|
+
# * #parent_name
|
|
125
|
+
|
|
126
|
+
def marshal_load(array)
|
|
127
|
+
initialize_visibility
|
|
128
|
+
|
|
129
|
+
@aliases = []
|
|
130
|
+
@parent = nil
|
|
131
|
+
@parent_name = nil
|
|
132
|
+
@parent_class = nil
|
|
133
|
+
@section = nil
|
|
134
|
+
@file = nil
|
|
135
|
+
|
|
136
|
+
version = array[0]
|
|
137
|
+
@name = array[1]
|
|
138
|
+
@full_name = array[2]
|
|
139
|
+
@rw = array[3]
|
|
140
|
+
@visibility = array[4]
|
|
141
|
+
@comment = RDoc::Comment.from_document array[5]
|
|
142
|
+
@singleton = array[6] || false # MARSHAL_VERSION == 0
|
|
143
|
+
# 7 handled below
|
|
144
|
+
@parent_name = array[8]
|
|
145
|
+
@parent_class = array[9]
|
|
146
|
+
@section_title = array[10]
|
|
147
|
+
@type_signature_lines = array[11]&.split("\n")
|
|
148
|
+
|
|
149
|
+
@file = RDoc::TopLevel.new array[7] if version > 1
|
|
150
|
+
|
|
151
|
+
@parent_name ||= @full_name.split('#', 2).first
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def pretty_print(q) # :nodoc:
|
|
155
|
+
q.group 2, "[#{self.class.name} #{full_name} #{rw} #{visibility}", "]" do
|
|
156
|
+
unless comment.empty? then
|
|
157
|
+
q.breakable
|
|
158
|
+
q.text "comment:"
|
|
159
|
+
q.breakable
|
|
160
|
+
q.pp @comment
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
def to_s # :nodoc:
|
|
166
|
+
"#{definition} #{name} in: #{parent}"
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
##
|
|
170
|
+
# Attributes do not have token streams.
|
|
171
|
+
#
|
|
172
|
+
# An RDoc::Attr can show up in the method list in some situations (see
|
|
173
|
+
# Gem::ConfigFile)
|
|
174
|
+
|
|
175
|
+
def token_stream # :nodoc:
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
end
|