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.
Files changed (218) hide show
  1. checksums.yaml +7 -0
  2. data/mega-max-hub.gemspec +11 -0
  3. data/rdoc-8.0.0/CONTRIBUTING.md +195 -0
  4. data/rdoc-8.0.0/CVE-2013-0256.rdoc +49 -0
  5. data/rdoc-8.0.0/History.rdoc +1668 -0
  6. data/rdoc-8.0.0/LEGAL.rdoc +56 -0
  7. data/rdoc-8.0.0/LICENSE.rdoc +63 -0
  8. data/rdoc-8.0.0/README.md +236 -0
  9. data/rdoc-8.0.0/RI.md +842 -0
  10. data/rdoc-8.0.0/TODO.rdoc +60 -0
  11. data/rdoc-8.0.0/doc/markup_reference/markdown.md +659 -0
  12. data/rdoc-8.0.0/doc/markup_reference/rdoc.rdoc +1169 -0
  13. data/rdoc-8.0.0/exe/rdoc +43 -0
  14. data/rdoc-8.0.0/exe/ri +12 -0
  15. data/rdoc-8.0.0/lib/rdoc/code_object/alias.rb +98 -0
  16. data/rdoc-8.0.0/lib/rdoc/code_object/any_method.rb +387 -0
  17. data/rdoc-8.0.0/lib/rdoc/code_object/attr.rb +178 -0
  18. data/rdoc-8.0.0/lib/rdoc/code_object/class_module.rb +969 -0
  19. data/rdoc-8.0.0/lib/rdoc/code_object/constant.rb +221 -0
  20. data/rdoc-8.0.0/lib/rdoc/code_object/context/section.rb +182 -0
  21. data/rdoc-8.0.0/lib/rdoc/code_object/context.rb +1238 -0
  22. data/rdoc-8.0.0/lib/rdoc/code_object/extend.rb +9 -0
  23. data/rdoc-8.0.0/lib/rdoc/code_object/include.rb +9 -0
  24. data/rdoc-8.0.0/lib/rdoc/code_object/method_attr.rb +417 -0
  25. data/rdoc-8.0.0/lib/rdoc/code_object/mixin.rb +123 -0
  26. data/rdoc-8.0.0/lib/rdoc/code_object/normal_class.rb +92 -0
  27. data/rdoc-8.0.0/lib/rdoc/code_object/normal_module.rb +73 -0
  28. data/rdoc-8.0.0/lib/rdoc/code_object/require.rb +51 -0
  29. data/rdoc-8.0.0/lib/rdoc/code_object/single_class.rb +30 -0
  30. data/rdoc-8.0.0/lib/rdoc/code_object/top_level.rb +286 -0
  31. data/rdoc-8.0.0/lib/rdoc/code_object.rb +393 -0
  32. data/rdoc-8.0.0/lib/rdoc/code_objects.rb +5 -0
  33. data/rdoc-8.0.0/lib/rdoc/comment.rb +353 -0
  34. data/rdoc-8.0.0/lib/rdoc/cross_reference.rb +215 -0
  35. data/rdoc-8.0.0/lib/rdoc/encoding.rb +120 -0
  36. data/rdoc-8.0.0/lib/rdoc/erb_partial.rb +18 -0
  37. data/rdoc-8.0.0/lib/rdoc/erbio.rb +37 -0
  38. data/rdoc-8.0.0/lib/rdoc/generator/aliki.rb +200 -0
  39. data/rdoc-8.0.0/lib/rdoc/generator/darkfish.rb +824 -0
  40. data/rdoc-8.0.0/lib/rdoc/generator/json_index.rb +284 -0
  41. data/rdoc-8.0.0/lib/rdoc/generator/markup.rb +196 -0
  42. data/rdoc-8.0.0/lib/rdoc/generator/pot/message_extractor.rb +68 -0
  43. data/rdoc-8.0.0/lib/rdoc/generator/pot/po.rb +84 -0
  44. data/rdoc-8.0.0/lib/rdoc/generator/pot/po_entry.rb +141 -0
  45. data/rdoc-8.0.0/lib/rdoc/generator/pot.rb +94 -0
  46. data/rdoc-8.0.0/lib/rdoc/generator/ri.rb +30 -0
  47. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/DESIGN.md +536 -0
  48. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_aside_toc.rhtml +8 -0
  49. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_footer.rhtml +23 -0
  50. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_head.rhtml +163 -0
  51. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_header.rhtml +56 -0
  52. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_icons.rhtml +208 -0
  53. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_ancestors.rhtml +16 -0
  54. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_classes.rhtml +15 -0
  55. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +27 -0
  56. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +27 -0
  57. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml +16 -0
  58. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_methods.rhtml +41 -0
  59. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +67 -0
  60. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +15 -0
  61. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +21 -0
  62. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml +3 -0
  63. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/class.rhtml +230 -0
  64. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/css/rdoc.css +2181 -0
  65. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/index.rhtml +22 -0
  66. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/aliki.js +513 -0
  67. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/bash_highlighter.js +167 -0
  68. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/c_highlighter.js +299 -0
  69. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/search_controller.js +129 -0
  70. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/search_navigation.js +105 -0
  71. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/search_ranker.js +239 -0
  72. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/theme-toggle.js +112 -0
  73. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/page.rhtml +18 -0
  74. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +14 -0
  75. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/servlet_root.rhtml +65 -0
  76. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_footer.rhtml +5 -0
  77. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_head.rhtml +43 -0
  78. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +5 -0
  79. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +17 -0
  80. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +17 -0
  81. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +16 -0
  82. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +21 -0
  83. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml +11 -0
  84. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +32 -0
  85. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +6 -0
  86. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +15 -0
  87. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +11 -0
  88. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +39 -0
  89. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_toggle.rhtml +3 -0
  90. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/class.rhtml +220 -0
  91. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/css/fonts.css +167 -0
  92. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/css/rdoc.css +701 -0
  93. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf +0 -0
  94. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf +0 -0
  95. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf +0 -0
  96. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf +0 -0
  97. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf +0 -0
  98. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf +0 -0
  99. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/add.png +0 -0
  100. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/arrow_up.png +0 -0
  101. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/brick.png +0 -0
  102. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/brick_link.png +0 -0
  103. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bug.png +0 -0
  104. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bullet_black.png +0 -0
  105. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png +0 -0
  106. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png +0 -0
  107. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/date.png +0 -0
  108. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/delete.png +0 -0
  109. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/find.png +0 -0
  110. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif +0 -0
  111. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/macFFBgHack.png +0 -0
  112. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/package.png +0 -0
  113. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/page_green.png +0 -0
  114. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/page_white_text.png +0 -0
  115. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/page_white_width.png +0 -0
  116. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/plugin.png +0 -0
  117. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/ruby.png +0 -0
  118. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/tag_blue.png +0 -0
  119. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/tag_green.png +0 -0
  120. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/transparent.png +0 -0
  121. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/wrench.png +0 -0
  122. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/wrench_orange.png +0 -0
  123. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/zoom.png +0 -0
  124. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/index.rhtml +24 -0
  125. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/js/darkfish.js +140 -0
  126. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/js/search.js +120 -0
  127. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/page.rhtml +19 -0
  128. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +21 -0
  129. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +65 -0
  130. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +72 -0
  131. data/rdoc-8.0.0/lib/rdoc/generator/template/json_index/js/navigation.js +105 -0
  132. data/rdoc-8.0.0/lib/rdoc/generator/template/json_index/js/searcher.js +271 -0
  133. data/rdoc-8.0.0/lib/rdoc/generator.rb +52 -0
  134. data/rdoc-8.0.0/lib/rdoc/i18n/locale.rb +102 -0
  135. data/rdoc-8.0.0/lib/rdoc/i18n/text.rb +126 -0
  136. data/rdoc-8.0.0/lib/rdoc/i18n.rb +10 -0
  137. data/rdoc-8.0.0/lib/rdoc/known_classes.rb +74 -0
  138. data/rdoc-8.0.0/lib/rdoc/markdown/entities.rb +2131 -0
  139. data/rdoc-8.0.0/lib/rdoc/markdown/literals.kpeg +21 -0
  140. data/rdoc-8.0.0/lib/rdoc/markdown/literals.rb +454 -0
  141. data/rdoc-8.0.0/lib/rdoc/markdown.kpeg +1315 -0
  142. data/rdoc-8.0.0/lib/rdoc/markdown.rb +16865 -0
  143. data/rdoc-8.0.0/lib/rdoc/markup/blank_line.rb +29 -0
  144. data/rdoc-8.0.0/lib/rdoc/markup/block_quote.rb +14 -0
  145. data/rdoc-8.0.0/lib/rdoc/markup/document.rb +164 -0
  146. data/rdoc-8.0.0/lib/rdoc/markup/element.rb +21 -0
  147. data/rdoc-8.0.0/lib/rdoc/markup/formatter.rb +285 -0
  148. data/rdoc-8.0.0/lib/rdoc/markup/hard_break.rb +34 -0
  149. data/rdoc-8.0.0/lib/rdoc/markup/heading.rb +170 -0
  150. data/rdoc-8.0.0/lib/rdoc/markup/include.rb +42 -0
  151. data/rdoc-8.0.0/lib/rdoc/markup/indented_paragraph.rb +47 -0
  152. data/rdoc-8.0.0/lib/rdoc/markup/inline_parser.rb +312 -0
  153. data/rdoc-8.0.0/lib/rdoc/markup/list.rb +101 -0
  154. data/rdoc-8.0.0/lib/rdoc/markup/list_item.rb +99 -0
  155. data/rdoc-8.0.0/lib/rdoc/markup/paragraph.rb +28 -0
  156. data/rdoc-8.0.0/lib/rdoc/markup/parser.rb +585 -0
  157. data/rdoc-8.0.0/lib/rdoc/markup/pre_process.rb +317 -0
  158. data/rdoc-8.0.0/lib/rdoc/markup/raw.rb +66 -0
  159. data/rdoc-8.0.0/lib/rdoc/markup/rule.rb +20 -0
  160. data/rdoc-8.0.0/lib/rdoc/markup/table.rb +64 -0
  161. data/rdoc-8.0.0/lib/rdoc/markup/to_ansi.rb +144 -0
  162. data/rdoc-8.0.0/lib/rdoc/markup/to_bs.rb +86 -0
  163. data/rdoc-8.0.0/lib/rdoc/markup/to_html.rb +682 -0
  164. data/rdoc-8.0.0/lib/rdoc/markup/to_html_crossref.rb +261 -0
  165. data/rdoc-8.0.0/lib/rdoc/markup/to_html_snippet.rb +287 -0
  166. data/rdoc-8.0.0/lib/rdoc/markup/to_joined_paragraph.rb +41 -0
  167. data/rdoc-8.0.0/lib/rdoc/markup/to_label.rb +84 -0
  168. data/rdoc-8.0.0/lib/rdoc/markup/to_markdown.rb +215 -0
  169. data/rdoc-8.0.0/lib/rdoc/markup/to_rdoc.rb +421 -0
  170. data/rdoc-8.0.0/lib/rdoc/markup/to_table_of_contents.rb +88 -0
  171. data/rdoc-8.0.0/lib/rdoc/markup/to_test.rb +77 -0
  172. data/rdoc-8.0.0/lib/rdoc/markup/to_tt_only.rb +107 -0
  173. data/rdoc-8.0.0/lib/rdoc/markup/verbatim.rb +83 -0
  174. data/rdoc-8.0.0/lib/rdoc/markup.rb +219 -0
  175. data/rdoc-8.0.0/lib/rdoc/options.rb +1412 -0
  176. data/rdoc-8.0.0/lib/rdoc/parser/c.rb +1227 -0
  177. data/rdoc-8.0.0/lib/rdoc/parser/changelog.rb +379 -0
  178. data/rdoc-8.0.0/lib/rdoc/parser/markdown.rb +22 -0
  179. data/rdoc-8.0.0/lib/rdoc/parser/rbs.rb +275 -0
  180. data/rdoc-8.0.0/lib/rdoc/parser/rd.rb +22 -0
  181. data/rdoc-8.0.0/lib/rdoc/parser/ruby.rb +1266 -0
  182. data/rdoc-8.0.0/lib/rdoc/parser/ruby_colorizer.rb +253 -0
  183. data/rdoc-8.0.0/lib/rdoc/parser/simple.rb +44 -0
  184. data/rdoc-8.0.0/lib/rdoc/parser/text.rb +11 -0
  185. data/rdoc-8.0.0/lib/rdoc/parser.rb +298 -0
  186. data/rdoc-8.0.0/lib/rdoc/rbs_helper.rb +186 -0
  187. data/rdoc-8.0.0/lib/rdoc/rd/block_parser.rb +1706 -0
  188. data/rdoc-8.0.0/lib/rdoc/rd/block_parser.ry +643 -0
  189. data/rdoc-8.0.0/lib/rdoc/rd/inline.rb +71 -0
  190. data/rdoc-8.0.0/lib/rdoc/rd/inline_parser.rb +1854 -0
  191. data/rdoc-8.0.0/lib/rdoc/rd/inline_parser.ry +593 -0
  192. data/rdoc-8.0.0/lib/rdoc/rd.rb +99 -0
  193. data/rdoc-8.0.0/lib/rdoc/rdoc.rb +724 -0
  194. data/rdoc-8.0.0/lib/rdoc/ri/driver.rb +1572 -0
  195. data/rdoc-8.0.0/lib/rdoc/ri/formatter.rb +6 -0
  196. data/rdoc-8.0.0/lib/rdoc/ri/paths.rb +171 -0
  197. data/rdoc-8.0.0/lib/rdoc/ri/servlet.rb +452 -0
  198. data/rdoc-8.0.0/lib/rdoc/ri/store.rb +6 -0
  199. data/rdoc-8.0.0/lib/rdoc/ri/task.rb +71 -0
  200. data/rdoc-8.0.0/lib/rdoc/ri.rb +21 -0
  201. data/rdoc-8.0.0/lib/rdoc/rubygems_hook.rb +327 -0
  202. data/rdoc-8.0.0/lib/rdoc/server.rb +460 -0
  203. data/rdoc-8.0.0/lib/rdoc/stats/normal.rb +58 -0
  204. data/rdoc-8.0.0/lib/rdoc/stats/quiet.rb +59 -0
  205. data/rdoc-8.0.0/lib/rdoc/stats/verbose.rb +44 -0
  206. data/rdoc-8.0.0/lib/rdoc/stats.rb +484 -0
  207. data/rdoc-8.0.0/lib/rdoc/store.rb +1205 -0
  208. data/rdoc-8.0.0/lib/rdoc/task.rb +355 -0
  209. data/rdoc-8.0.0/lib/rdoc/text.rb +244 -0
  210. data/rdoc-8.0.0/lib/rdoc/token_stream.rb +104 -0
  211. data/rdoc-8.0.0/lib/rdoc/tom_doc.rb +257 -0
  212. data/rdoc-8.0.0/lib/rdoc/version.rb +10 -0
  213. data/rdoc-8.0.0/lib/rdoc.rb +239 -0
  214. data/rdoc-8.0.0/lib/rubygems_plugin.rb +14 -0
  215. data/rdoc-8.0.0/man/ri.1 +249 -0
  216. data/rdoc-8.0.0/rdoc-logo.svg +43 -0
  217. data/rdoc-8.0.0/rdoc.gemspec +74 -0
  218. metadata +256 -0
@@ -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,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ begin
4
+ gem 'rdoc'
5
+ rescue NameError => e # --disable-gems
6
+ raise unless e.name == :gem
7
+ rescue Gem::LoadError
8
+ end
9
+
10
+ require 'rdoc/ri/driver'
11
+
12
+ RDoc::RI::Driver.run ARGV
@@ -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