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.
Files changed (218) hide show
  1. checksums.yaml +7 -0
  2. data/rdoc-8.0.0/CONTRIBUTING.md +195 -0
  3. data/rdoc-8.0.0/CVE-2013-0256.rdoc +49 -0
  4. data/rdoc-8.0.0/History.rdoc +1668 -0
  5. data/rdoc-8.0.0/LEGAL.rdoc +56 -0
  6. data/rdoc-8.0.0/LICENSE.rdoc +63 -0
  7. data/rdoc-8.0.0/README.md +236 -0
  8. data/rdoc-8.0.0/RI.md +842 -0
  9. data/rdoc-8.0.0/TODO.rdoc +60 -0
  10. data/rdoc-8.0.0/doc/markup_reference/markdown.md +659 -0
  11. data/rdoc-8.0.0/doc/markup_reference/rdoc.rdoc +1169 -0
  12. data/rdoc-8.0.0/exe/rdoc +43 -0
  13. data/rdoc-8.0.0/exe/ri +12 -0
  14. data/rdoc-8.0.0/lib/rdoc/code_object/alias.rb +98 -0
  15. data/rdoc-8.0.0/lib/rdoc/code_object/any_method.rb +387 -0
  16. data/rdoc-8.0.0/lib/rdoc/code_object/attr.rb +178 -0
  17. data/rdoc-8.0.0/lib/rdoc/code_object/class_module.rb +969 -0
  18. data/rdoc-8.0.0/lib/rdoc/code_object/constant.rb +221 -0
  19. data/rdoc-8.0.0/lib/rdoc/code_object/context/section.rb +182 -0
  20. data/rdoc-8.0.0/lib/rdoc/code_object/context.rb +1238 -0
  21. data/rdoc-8.0.0/lib/rdoc/code_object/extend.rb +9 -0
  22. data/rdoc-8.0.0/lib/rdoc/code_object/include.rb +9 -0
  23. data/rdoc-8.0.0/lib/rdoc/code_object/method_attr.rb +417 -0
  24. data/rdoc-8.0.0/lib/rdoc/code_object/mixin.rb +123 -0
  25. data/rdoc-8.0.0/lib/rdoc/code_object/normal_class.rb +92 -0
  26. data/rdoc-8.0.0/lib/rdoc/code_object/normal_module.rb +73 -0
  27. data/rdoc-8.0.0/lib/rdoc/code_object/require.rb +51 -0
  28. data/rdoc-8.0.0/lib/rdoc/code_object/single_class.rb +30 -0
  29. data/rdoc-8.0.0/lib/rdoc/code_object/top_level.rb +286 -0
  30. data/rdoc-8.0.0/lib/rdoc/code_object.rb +393 -0
  31. data/rdoc-8.0.0/lib/rdoc/code_objects.rb +5 -0
  32. data/rdoc-8.0.0/lib/rdoc/comment.rb +353 -0
  33. data/rdoc-8.0.0/lib/rdoc/cross_reference.rb +215 -0
  34. data/rdoc-8.0.0/lib/rdoc/encoding.rb +120 -0
  35. data/rdoc-8.0.0/lib/rdoc/erb_partial.rb +18 -0
  36. data/rdoc-8.0.0/lib/rdoc/erbio.rb +37 -0
  37. data/rdoc-8.0.0/lib/rdoc/generator/aliki.rb +200 -0
  38. data/rdoc-8.0.0/lib/rdoc/generator/darkfish.rb +824 -0
  39. data/rdoc-8.0.0/lib/rdoc/generator/json_index.rb +284 -0
  40. data/rdoc-8.0.0/lib/rdoc/generator/markup.rb +196 -0
  41. data/rdoc-8.0.0/lib/rdoc/generator/pot/message_extractor.rb +68 -0
  42. data/rdoc-8.0.0/lib/rdoc/generator/pot/po.rb +84 -0
  43. data/rdoc-8.0.0/lib/rdoc/generator/pot/po_entry.rb +141 -0
  44. data/rdoc-8.0.0/lib/rdoc/generator/pot.rb +94 -0
  45. data/rdoc-8.0.0/lib/rdoc/generator/ri.rb +30 -0
  46. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/DESIGN.md +536 -0
  47. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_aside_toc.rhtml +8 -0
  48. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_footer.rhtml +23 -0
  49. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_head.rhtml +163 -0
  50. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_header.rhtml +56 -0
  51. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_icons.rhtml +208 -0
  52. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_ancestors.rhtml +16 -0
  53. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_classes.rhtml +15 -0
  54. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +27 -0
  55. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +27 -0
  56. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml +16 -0
  57. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_methods.rhtml +41 -0
  58. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +67 -0
  59. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +15 -0
  60. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +21 -0
  61. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml +3 -0
  62. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/class.rhtml +230 -0
  63. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/css/rdoc.css +2181 -0
  64. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/index.rhtml +22 -0
  65. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/aliki.js +513 -0
  66. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/bash_highlighter.js +167 -0
  67. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/c_highlighter.js +299 -0
  68. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/search_controller.js +129 -0
  69. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/search_navigation.js +105 -0
  70. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/search_ranker.js +239 -0
  71. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/theme-toggle.js +112 -0
  72. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/page.rhtml +18 -0
  73. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +14 -0
  74. data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/servlet_root.rhtml +65 -0
  75. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_footer.rhtml +5 -0
  76. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_head.rhtml +43 -0
  77. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +5 -0
  78. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +17 -0
  79. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +17 -0
  80. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +16 -0
  81. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +21 -0
  82. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml +11 -0
  83. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +32 -0
  84. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +6 -0
  85. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +15 -0
  86. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +11 -0
  87. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +39 -0
  88. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_toggle.rhtml +3 -0
  89. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/class.rhtml +220 -0
  90. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/css/fonts.css +167 -0
  91. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/css/rdoc.css +701 -0
  92. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf +0 -0
  93. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf +0 -0
  94. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf +0 -0
  95. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf +0 -0
  96. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf +0 -0
  97. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf +0 -0
  98. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/add.png +0 -0
  99. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/arrow_up.png +0 -0
  100. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/brick.png +0 -0
  101. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/brick_link.png +0 -0
  102. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bug.png +0 -0
  103. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bullet_black.png +0 -0
  104. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png +0 -0
  105. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png +0 -0
  106. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/date.png +0 -0
  107. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/delete.png +0 -0
  108. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/find.png +0 -0
  109. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif +0 -0
  110. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/macFFBgHack.png +0 -0
  111. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/package.png +0 -0
  112. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/page_green.png +0 -0
  113. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/page_white_text.png +0 -0
  114. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/page_white_width.png +0 -0
  115. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/plugin.png +0 -0
  116. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/ruby.png +0 -0
  117. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/tag_blue.png +0 -0
  118. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/tag_green.png +0 -0
  119. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/transparent.png +0 -0
  120. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/wrench.png +0 -0
  121. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/wrench_orange.png +0 -0
  122. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/zoom.png +0 -0
  123. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/index.rhtml +24 -0
  124. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/js/darkfish.js +140 -0
  125. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/js/search.js +120 -0
  126. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/page.rhtml +19 -0
  127. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +21 -0
  128. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +65 -0
  129. data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +72 -0
  130. data/rdoc-8.0.0/lib/rdoc/generator/template/json_index/js/navigation.js +105 -0
  131. data/rdoc-8.0.0/lib/rdoc/generator/template/json_index/js/searcher.js +271 -0
  132. data/rdoc-8.0.0/lib/rdoc/generator.rb +52 -0
  133. data/rdoc-8.0.0/lib/rdoc/i18n/locale.rb +102 -0
  134. data/rdoc-8.0.0/lib/rdoc/i18n/text.rb +126 -0
  135. data/rdoc-8.0.0/lib/rdoc/i18n.rb +10 -0
  136. data/rdoc-8.0.0/lib/rdoc/known_classes.rb +74 -0
  137. data/rdoc-8.0.0/lib/rdoc/markdown/entities.rb +2131 -0
  138. data/rdoc-8.0.0/lib/rdoc/markdown/literals.kpeg +21 -0
  139. data/rdoc-8.0.0/lib/rdoc/markdown/literals.rb +454 -0
  140. data/rdoc-8.0.0/lib/rdoc/markdown.kpeg +1315 -0
  141. data/rdoc-8.0.0/lib/rdoc/markdown.rb +16865 -0
  142. data/rdoc-8.0.0/lib/rdoc/markup/blank_line.rb +29 -0
  143. data/rdoc-8.0.0/lib/rdoc/markup/block_quote.rb +14 -0
  144. data/rdoc-8.0.0/lib/rdoc/markup/document.rb +164 -0
  145. data/rdoc-8.0.0/lib/rdoc/markup/element.rb +21 -0
  146. data/rdoc-8.0.0/lib/rdoc/markup/formatter.rb +285 -0
  147. data/rdoc-8.0.0/lib/rdoc/markup/hard_break.rb +34 -0
  148. data/rdoc-8.0.0/lib/rdoc/markup/heading.rb +170 -0
  149. data/rdoc-8.0.0/lib/rdoc/markup/include.rb +42 -0
  150. data/rdoc-8.0.0/lib/rdoc/markup/indented_paragraph.rb +47 -0
  151. data/rdoc-8.0.0/lib/rdoc/markup/inline_parser.rb +312 -0
  152. data/rdoc-8.0.0/lib/rdoc/markup/list.rb +101 -0
  153. data/rdoc-8.0.0/lib/rdoc/markup/list_item.rb +99 -0
  154. data/rdoc-8.0.0/lib/rdoc/markup/paragraph.rb +28 -0
  155. data/rdoc-8.0.0/lib/rdoc/markup/parser.rb +585 -0
  156. data/rdoc-8.0.0/lib/rdoc/markup/pre_process.rb +317 -0
  157. data/rdoc-8.0.0/lib/rdoc/markup/raw.rb +66 -0
  158. data/rdoc-8.0.0/lib/rdoc/markup/rule.rb +20 -0
  159. data/rdoc-8.0.0/lib/rdoc/markup/table.rb +64 -0
  160. data/rdoc-8.0.0/lib/rdoc/markup/to_ansi.rb +144 -0
  161. data/rdoc-8.0.0/lib/rdoc/markup/to_bs.rb +86 -0
  162. data/rdoc-8.0.0/lib/rdoc/markup/to_html.rb +682 -0
  163. data/rdoc-8.0.0/lib/rdoc/markup/to_html_crossref.rb +261 -0
  164. data/rdoc-8.0.0/lib/rdoc/markup/to_html_snippet.rb +287 -0
  165. data/rdoc-8.0.0/lib/rdoc/markup/to_joined_paragraph.rb +41 -0
  166. data/rdoc-8.0.0/lib/rdoc/markup/to_label.rb +84 -0
  167. data/rdoc-8.0.0/lib/rdoc/markup/to_markdown.rb +215 -0
  168. data/rdoc-8.0.0/lib/rdoc/markup/to_rdoc.rb +421 -0
  169. data/rdoc-8.0.0/lib/rdoc/markup/to_table_of_contents.rb +88 -0
  170. data/rdoc-8.0.0/lib/rdoc/markup/to_test.rb +77 -0
  171. data/rdoc-8.0.0/lib/rdoc/markup/to_tt_only.rb +107 -0
  172. data/rdoc-8.0.0/lib/rdoc/markup/verbatim.rb +83 -0
  173. data/rdoc-8.0.0/lib/rdoc/markup.rb +219 -0
  174. data/rdoc-8.0.0/lib/rdoc/options.rb +1412 -0
  175. data/rdoc-8.0.0/lib/rdoc/parser/c.rb +1227 -0
  176. data/rdoc-8.0.0/lib/rdoc/parser/changelog.rb +379 -0
  177. data/rdoc-8.0.0/lib/rdoc/parser/markdown.rb +22 -0
  178. data/rdoc-8.0.0/lib/rdoc/parser/rbs.rb +275 -0
  179. data/rdoc-8.0.0/lib/rdoc/parser/rd.rb +22 -0
  180. data/rdoc-8.0.0/lib/rdoc/parser/ruby.rb +1266 -0
  181. data/rdoc-8.0.0/lib/rdoc/parser/ruby_colorizer.rb +253 -0
  182. data/rdoc-8.0.0/lib/rdoc/parser/simple.rb +44 -0
  183. data/rdoc-8.0.0/lib/rdoc/parser/text.rb +11 -0
  184. data/rdoc-8.0.0/lib/rdoc/parser.rb +298 -0
  185. data/rdoc-8.0.0/lib/rdoc/rbs_helper.rb +186 -0
  186. data/rdoc-8.0.0/lib/rdoc/rd/block_parser.rb +1706 -0
  187. data/rdoc-8.0.0/lib/rdoc/rd/block_parser.ry +643 -0
  188. data/rdoc-8.0.0/lib/rdoc/rd/inline.rb +71 -0
  189. data/rdoc-8.0.0/lib/rdoc/rd/inline_parser.rb +1854 -0
  190. data/rdoc-8.0.0/lib/rdoc/rd/inline_parser.ry +593 -0
  191. data/rdoc-8.0.0/lib/rdoc/rd.rb +99 -0
  192. data/rdoc-8.0.0/lib/rdoc/rdoc.rb +724 -0
  193. data/rdoc-8.0.0/lib/rdoc/ri/driver.rb +1572 -0
  194. data/rdoc-8.0.0/lib/rdoc/ri/formatter.rb +6 -0
  195. data/rdoc-8.0.0/lib/rdoc/ri/paths.rb +171 -0
  196. data/rdoc-8.0.0/lib/rdoc/ri/servlet.rb +452 -0
  197. data/rdoc-8.0.0/lib/rdoc/ri/store.rb +6 -0
  198. data/rdoc-8.0.0/lib/rdoc/ri/task.rb +71 -0
  199. data/rdoc-8.0.0/lib/rdoc/ri.rb +21 -0
  200. data/rdoc-8.0.0/lib/rdoc/rubygems_hook.rb +327 -0
  201. data/rdoc-8.0.0/lib/rdoc/server.rb +460 -0
  202. data/rdoc-8.0.0/lib/rdoc/stats/normal.rb +58 -0
  203. data/rdoc-8.0.0/lib/rdoc/stats/quiet.rb +59 -0
  204. data/rdoc-8.0.0/lib/rdoc/stats/verbose.rb +44 -0
  205. data/rdoc-8.0.0/lib/rdoc/stats.rb +484 -0
  206. data/rdoc-8.0.0/lib/rdoc/store.rb +1205 -0
  207. data/rdoc-8.0.0/lib/rdoc/task.rb +355 -0
  208. data/rdoc-8.0.0/lib/rdoc/text.rb +244 -0
  209. data/rdoc-8.0.0/lib/rdoc/token_stream.rb +104 -0
  210. data/rdoc-8.0.0/lib/rdoc/tom_doc.rb +257 -0
  211. data/rdoc-8.0.0/lib/rdoc/version.rb +10 -0
  212. data/rdoc-8.0.0/lib/rdoc.rb +239 -0
  213. data/rdoc-8.0.0/lib/rubygems_plugin.rb +14 -0
  214. data/rdoc-8.0.0/man/ri.1 +249 -0
  215. data/rdoc-8.0.0/rdoc-logo.svg +43 -0
  216. data/rdoc-8.0.0/rdoc.gemspec +74 -0
  217. data/super-quick-rb.gemspec +12 -0
  218. metadata +257 -0
@@ -0,0 +1,257 @@
1
+ # frozen_string_literal: true
2
+ # :markup: tomdoc
3
+
4
+ # A parser for TomDoc based on TomDoc 1.0.0-rc1 (02adef9b5a)
5
+ #
6
+ # The TomDoc specification can be found at http://tomdoc.org.
7
+ #
8
+ # To choose TomDoc as your only default format see RDoc::Options@Saved+Options
9
+ # for instructions on setting up a <code>.rdoc_options</code> file to store
10
+ # your project default.
11
+ #
12
+ # There are a few differences between this parser and the specification. A
13
+ # best-effort was made to follow the specification as closely as possible but
14
+ # some choices to deviate were made.
15
+ #
16
+ # A future version of RDoc will warn when a MUST or MUST NOT is violated and
17
+ # may warn when a SHOULD or SHOULD NOT is violated. RDoc will always try
18
+ # to emit documentation even if given invalid TomDoc.
19
+ #
20
+ # Here are some implementation choices this parser currently makes:
21
+ #
22
+ # This parser allows rdoc-style inline markup but you should not depended on
23
+ # it.
24
+ #
25
+ # This parser allows a space between the comment and the method body.
26
+ #
27
+ # This parser does not require the default value to be described for an
28
+ # optional argument.
29
+ #
30
+ # This parser does not examine the order of sections. An Examples section may
31
+ # precede the Arguments section.
32
+ #
33
+ # This class is documented in TomDoc format. Since this is a subclass of the
34
+ # RDoc markup parser there isn't much to see here, unfortunately.
35
+
36
+ class RDoc::TomDoc < RDoc::Markup::Parser
37
+
38
+ # Internal: Token accessor
39
+
40
+ attr_reader :tokens
41
+
42
+ # Internal: Adds a post-processor which sets the RDoc section based on the
43
+ # comment's status.
44
+ #
45
+ # Returns nothing.
46
+
47
+ def self.add_post_processor # :nodoc:
48
+ RDoc::Markup::PreProcess.post_process do |comment, code_object|
49
+ next unless code_object and
50
+ RDoc::Comment === comment and comment.format == 'tomdoc'
51
+
52
+ comment.text.gsub!(/\A(\s*# |)(Public|Internal|Deprecated):\s+/) do
53
+ section = code_object.add_section $2
54
+ code_object.temporary_section = section
55
+
56
+ $1
57
+ end
58
+ end
59
+ end
60
+
61
+ add_post_processor
62
+
63
+ # Public: Parses TomDoc from text
64
+ #
65
+ # text - A String containing TomDoc-format text.
66
+ #
67
+ # Examples
68
+ #
69
+ # RDoc::TomDoc.parse <<-TOMDOC
70
+ # This method does some things
71
+ #
72
+ # Returns nothing.
73
+ # TOMDOC
74
+ # # => #<RDoc::Markup::Document:0xXXX @parts=[...], @file=nil>
75
+ #
76
+ # Returns an RDoc::Markup::Document representing the TomDoc format.
77
+
78
+ def self.parse(text)
79
+ parser = new
80
+
81
+ parser.tokenize text
82
+ doc = RDoc::Markup::Document.new
83
+ parser.parse doc
84
+ doc
85
+ end
86
+
87
+ # Internal: Extracts the Signature section's method signature
88
+ #
89
+ # comment - An RDoc::Comment that will be parsed and have the signature
90
+ # extracted
91
+ #
92
+ # Returns a String containing the signature and nil if not
93
+
94
+ def self.signature(comment)
95
+ return unless comment.tomdoc?
96
+
97
+ document = comment.parse
98
+
99
+ signature = nil
100
+ found_heading = false
101
+ found_signature = false
102
+
103
+ document.parts.delete_if do |part|
104
+ next false if found_signature
105
+
106
+ found_heading ||=
107
+ RDoc::Markup::Heading === part && part.text == 'Signature'
108
+
109
+ next false unless found_heading
110
+
111
+ next true if RDoc::Markup::BlankLine === part
112
+
113
+ if RDoc::Markup::Verbatim === part then
114
+ signature = part
115
+ found_signature = true
116
+ end
117
+ end
118
+
119
+ signature and signature.text
120
+ end
121
+
122
+ # Public: Creates a new TomDoc parser. See also RDoc::Markup::parse
123
+
124
+ def initialize
125
+ super
126
+
127
+ @section = nil
128
+ @seen_returns = false
129
+ end
130
+
131
+ # Internal: Builds a heading from the token stream
132
+ #
133
+ # level - The level of heading to create
134
+ #
135
+ # Returns an RDoc::Markup::Heading
136
+
137
+ def build_heading(level)
138
+ heading = super
139
+
140
+ @section = heading.text
141
+
142
+ heading
143
+ end
144
+
145
+ # Internal: Builds a verbatim from the token stream. A verbatim in the
146
+ # Examples section will be marked as in Ruby format.
147
+ #
148
+ # margin - The indentation from the margin for lines that belong to this
149
+ # verbatim section.
150
+ #
151
+ # Returns an RDoc::Markup::Verbatim
152
+
153
+ def build_verbatim(margin)
154
+ verbatim = super
155
+
156
+ verbatim.format = :ruby if @section == 'Examples'
157
+
158
+ verbatim
159
+ end
160
+
161
+ # Internal: Builds a paragraph from the token stream
162
+ #
163
+ # margin - Unused
164
+ #
165
+ # Returns an RDoc::Markup::Paragraph.
166
+
167
+ def build_paragraph(margin)
168
+ p :paragraph_start => margin if @debug
169
+
170
+ paragraph = RDoc::Markup::Paragraph.new
171
+
172
+ until @tokens.empty? do
173
+ type, data, = get
174
+
175
+ case type
176
+ when :TEXT then
177
+ @section = 'Returns' if data =~ /\A(Returns|Raises)/
178
+
179
+ paragraph << data
180
+ when :NEWLINE then
181
+ if :TEXT == peek_token[0] then
182
+ # Lines beginning with 'Raises' in the Returns section should not be
183
+ # treated as multiline text
184
+ if 'Returns' == @section and
185
+ peek_token[1].start_with?('Raises') then
186
+ break
187
+ else
188
+ paragraph << ' '
189
+ end
190
+ else
191
+ break
192
+ end
193
+ else
194
+ unget
195
+ break
196
+ end
197
+ end
198
+
199
+ p :paragraph_end => margin if @debug
200
+
201
+ paragraph
202
+ end
203
+
204
+ ##
205
+ # Detects a section change to "Returns" and adds a heading
206
+
207
+ def parse_text(parent, indent) # :nodoc:
208
+ paragraph = build_paragraph indent
209
+
210
+ if false == @seen_returns and 'Returns' == @section then
211
+ @seen_returns = true
212
+ parent << RDoc::Markup::Heading.new(3, 'Returns')
213
+ parent << RDoc::Markup::BlankLine.new
214
+ end
215
+
216
+ parent << paragraph
217
+ end
218
+
219
+ # Internal: Turns text into an Array of tokens
220
+ #
221
+ # text - A String containing TomDoc-format text.
222
+ #
223
+ # Returns self.
224
+
225
+ def tokenize(text)
226
+ text = text.sub(/\A(Public|Internal|Deprecated):\s+/, '')
227
+
228
+ setup_scanner text
229
+
230
+ until @s.eos? do
231
+ pos = @s.pos
232
+
233
+ # leading spaces will be reflected by the column of the next token
234
+ # the only thing we loose are trailing spaces at the end of the file
235
+ next if @s.scan(/ +/)
236
+
237
+ @tokens << case
238
+ when @s.scan(/\r?\n/) then
239
+ token = [:NEWLINE, @s.matched, *pos]
240
+ @s.newline!
241
+ token
242
+ when @s.scan(/(Examples|Signature)$/) then
243
+ @tokens << [:HEADER, 3, *pos]
244
+
245
+ [:TEXT, @s[1], *pos]
246
+ when @s.scan(/([:\w][\w\[\]]*)[ ]+- /) then
247
+ [:NOTE, @s[1], *pos]
248
+ else
249
+ @s.scan(/.*/)
250
+ [:TEXT, @s.matched.sub(/\r$/, ''), *pos]
251
+ end
252
+ end
253
+
254
+ self
255
+ end
256
+
257
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RDoc
4
+
5
+ ##
6
+ # RDoc version you are using
7
+
8
+ VERSION = '8.0.0'
9
+
10
+ end
@@ -0,0 +1,239 @@
1
+ # frozen_string_literal: true
2
+ $DEBUG_RDOC = nil
3
+
4
+ ##
5
+ # RDoc produces documentation for Ruby source files by parsing the source and
6
+ # extracting the definition for classes, modules, methods, includes and
7
+ # requires. It associates these with optional documentation contained in an
8
+ # immediately preceding comment block then renders the result using an output
9
+ # formatter.
10
+ #
11
+ # For a simple introduction to writing or generating documentation using RDoc
12
+ # see the README.
13
+ #
14
+ # == Roadmap
15
+ #
16
+ # If you think you found a bug in RDoc see CONTRIBUTING@Bugs
17
+ #
18
+ # If you want to use RDoc to create documentation for your Ruby source files,
19
+ # see RDoc::Markup and refer to <tt>rdoc --help</tt> for command line usage.
20
+ #
21
+ # If you want to set the default markup format see
22
+ # RDoc::Markup@Markup+Formats
23
+ #
24
+ # If you want to store rdoc configuration in your gem (such as the default
25
+ # markup format) see RDoc::Options@Saved+Options
26
+ #
27
+ # If you want to write documentation for Ruby files see RDoc::Parser::Ruby
28
+ #
29
+ # If you want to write documentation for extensions written in C see
30
+ # RDoc::Parser::C
31
+ #
32
+ # If you want to generate documentation using <tt>rake</tt> see RDoc::Task.
33
+ #
34
+ # If you want to drive RDoc programmatically, see RDoc::RDoc.
35
+ #
36
+ # If you want to use the library to format text blocks into HTML or other
37
+ # formats, look at RDoc::Markup.
38
+ #
39
+ # If you want to make an RDoc plugin such as a generator or directive handler
40
+ # see RDoc::RDoc.
41
+ #
42
+ # If you want to write your own output generator see RDoc::Generator.
43
+ #
44
+ # If you want an overview of how RDoc works see CONTRIBUTING
45
+ #
46
+ # == Credits
47
+ #
48
+ # RDoc is currently being maintained by Eric Hodel <drbrain@segment7.net>.
49
+ #
50
+ # Dave Thomas <dave@pragmaticprogrammer.com> is the original author of RDoc.
51
+ #
52
+ # * The Ruby parser in rdoc/parse.rb is based heavily on the outstanding
53
+ # work of Keiju ISHITSUKA of Nippon Rational Inc, who produced the Ruby
54
+ # parser for irb and the rtags package.
55
+
56
+ module RDoc
57
+
58
+ ##
59
+ # Exception thrown by any rdoc error.
60
+
61
+ class Error < RuntimeError; end
62
+
63
+ require_relative 'rdoc/version'
64
+
65
+ ##
66
+ # Method visibilities
67
+
68
+ VISIBILITIES = [:public, :protected, :private]
69
+
70
+ ##
71
+ # Name of the dotfile that contains the description of files to be processed
72
+ # in the current directory
73
+
74
+ DOT_DOC_FILENAME = ".document"
75
+
76
+ ##
77
+ # General RDoc modifiers
78
+
79
+ GENERAL_MODIFIERS = %w[nodoc].freeze
80
+
81
+ ##
82
+ # RDoc modifiers for classes
83
+
84
+ CLASS_MODIFIERS = GENERAL_MODIFIERS
85
+
86
+ ##
87
+ # RDoc modifiers for attributes
88
+
89
+ ATTR_MODIFIERS = GENERAL_MODIFIERS
90
+
91
+ ##
92
+ # RDoc modifiers for constants
93
+
94
+ CONSTANT_MODIFIERS = GENERAL_MODIFIERS
95
+
96
+ ##
97
+ # RDoc modifiers for methods
98
+
99
+ METHOD_MODIFIERS = GENERAL_MODIFIERS +
100
+ %w[arg args yield yields notnew not-new not_new doc]
101
+
102
+ ##
103
+ # Loads the YAML backend used for <tt>.rdoc_options</tt>.
104
+ #
105
+ # Psych is preferred and used whenever it can be required. Requiring +yaml+
106
+ # is not attempted as a fallback because +yaml+ is merely a thin wrapper that
107
+ # loads Psych anyway. When Psych is genuinely unavailable, a minimal
108
+ # serializer shipped with RubyGems or Bundler is loaded instead, so that RDoc
109
+ # does not need a runtime dependency on Psych. Callers branch on whether
110
+ # Psych is defined and use ::yaml_serializer otherwise.
111
+
112
+ def self.load_yaml
113
+ begin
114
+ gem 'psych'
115
+ rescue NameError => e # --disable-gems
116
+ raise unless e.name == :gem
117
+ rescue Gem::LoadError
118
+ end
119
+
120
+ begin
121
+ require 'psych'
122
+ rescue ::LoadError
123
+ # Psych is unavailable; load the stub serializer shipped with RubyGems,
124
+ # or Bundler's copy on RubyGems older than 3.5 (Ruby 3.2) where
125
+ # rubygems/yaml_serializer does not exist yet.
126
+ begin
127
+ require 'rubygems/yaml_serializer'
128
+ rescue ::LoadError
129
+ require 'bundler/yaml_serializer'
130
+ end
131
+ end
132
+ end
133
+
134
+ ##
135
+ # The minimal YAML serializer module loaded by ::load_yaml as a fallback.
136
+ # Only meaningful when Psych is not defined.
137
+
138
+ def self.yaml_serializer
139
+ defined?(Gem::YAMLSerializer) ? Gem::YAMLSerializer : Bundler::YAMLSerializer
140
+ end
141
+
142
+ ##
143
+ # Searches and returns the directory for settings.
144
+ #
145
+ # 1. <tt>$HOME/.rdoc</tt> directory, if it exists.
146
+ # 2. The +rdoc+ directory under the path specified by the
147
+ # +XDG_DATA_HOME+ environment variable, if it is set.
148
+ # 3. <tt>$HOME/.local/share/rdoc</tt> directory.
149
+ #
150
+ # Other than the home directory, the containing directory will be
151
+ # created automatically.
152
+
153
+ def self.home
154
+ rdoc_dir = begin
155
+ File.expand_path('~/.rdoc')
156
+ rescue ArgumentError
157
+ end
158
+
159
+ if File.directory?(rdoc_dir)
160
+ rdoc_dir
161
+ else
162
+ require 'fileutils'
163
+ begin
164
+ # XDG
165
+ xdg_data_home = ENV["XDG_DATA_HOME"] || File.join(File.expand_path("~"), '.local', 'share')
166
+ unless File.exist?(xdg_data_home)
167
+ FileUtils.mkdir_p xdg_data_home
168
+ end
169
+ File.join xdg_data_home, "rdoc"
170
+ rescue Errno::EACCES
171
+ end
172
+ end
173
+ end
174
+
175
+ ##
176
+ # Returns +File.mtime(file)+, or +nil+ if the file cannot be stat'd
177
+ # (missing, permission denied, etc.).
178
+
179
+ def self.safe_mtime(file)
180
+ File.mtime(file)
181
+ rescue SystemCallError
182
+ nil
183
+ end
184
+
185
+ autoload :RDoc, "#{__dir__}/rdoc/rdoc"
186
+
187
+ autoload :CrossReference, "#{__dir__}/rdoc/cross_reference"
188
+ autoload :ERBIO, "#{__dir__}/rdoc/erbio"
189
+ autoload :ERBPartial, "#{__dir__}/rdoc/erb_partial"
190
+ autoload :Encoding, "#{__dir__}/rdoc/encoding"
191
+ autoload :Generator, "#{__dir__}/rdoc/generator"
192
+ autoload :Options, "#{__dir__}/rdoc/options"
193
+ autoload :Parser, "#{__dir__}/rdoc/parser"
194
+ autoload :Server, "#{__dir__}/rdoc/server"
195
+ autoload :RI, "#{__dir__}/rdoc/ri"
196
+ autoload :Stats, "#{__dir__}/rdoc/stats"
197
+ autoload :Store, "#{__dir__}/rdoc/store"
198
+ autoload :Task, "#{__dir__}/rdoc/task"
199
+ autoload :Text, "#{__dir__}/rdoc/text"
200
+
201
+ autoload :Markdown, "#{__dir__}/rdoc/markdown"
202
+ autoload :Markup, "#{__dir__}/rdoc/markup"
203
+ autoload :RD, "#{__dir__}/rdoc/rd"
204
+ autoload :TomDoc, "#{__dir__}/rdoc/tom_doc"
205
+
206
+ autoload :KNOWN_CLASSES, "#{__dir__}/rdoc/known_classes"
207
+
208
+ autoload :TokenStream, "#{__dir__}/rdoc/token_stream"
209
+
210
+ autoload :Comment, "#{__dir__}/rdoc/comment"
211
+
212
+ require_relative 'rdoc/i18n'
213
+
214
+ # code objects
215
+ #
216
+ # We represent the various high-level code constructs that appear in Ruby
217
+ # programs: classes, modules, methods, and so on.
218
+ autoload :CodeObject, "#{__dir__}/rdoc/code_object"
219
+
220
+ autoload :Context, "#{__dir__}/rdoc/code_object/context"
221
+ autoload :TopLevel, "#{__dir__}/rdoc/code_object/top_level"
222
+
223
+ autoload :ClassModule, "#{__dir__}/rdoc/code_object/class_module"
224
+ autoload :NormalClass, "#{__dir__}/rdoc/code_object/normal_class"
225
+ autoload :NormalModule, "#{__dir__}/rdoc/code_object/normal_module"
226
+ autoload :SingleClass, "#{__dir__}/rdoc/code_object/single_class"
227
+
228
+ autoload :Alias, "#{__dir__}/rdoc/code_object/alias"
229
+ autoload :AnyMethod, "#{__dir__}/rdoc/code_object/any_method"
230
+ autoload :MethodAttr, "#{__dir__}/rdoc/code_object/method_attr"
231
+ autoload :Attr, "#{__dir__}/rdoc/code_object/attr"
232
+
233
+ autoload :Constant, "#{__dir__}/rdoc/code_object/constant"
234
+ autoload :Mixin, "#{__dir__}/rdoc/code_object/mixin"
235
+ autoload :Include, "#{__dir__}/rdoc/code_object/include"
236
+ autoload :Extend, "#{__dir__}/rdoc/code_object/extend"
237
+ autoload :Require, "#{__dir__}/rdoc/code_object/require"
238
+
239
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ # If this file is exist, RDoc generates and removes documents by rubygems plugins.
4
+ #
5
+ # In follwing cases,
6
+ # RubyGems directly exectute RDoc::RubygemsHook.generation_hook and RDoc::RubygemsHook#remove to generate and remove documents.
7
+ #
8
+ # - RDoc is used as a default gem.
9
+ # - RDoc is a old version that doesn't have rubygems_plugin.rb.
10
+
11
+ require_relative 'rdoc/rubygems_hook'
12
+
13
+ Gem.done_installing(&RDoc::RubyGemsHook.method(:generate))
14
+ Gem.pre_uninstall(&RDoc::RubyGemsHook.method(:remove))