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,355 @@
1
+ # frozen_string_literal: true
2
+ #--
3
+ # Copyright (c) 2003, 2004 Jim Weirich, 2009 Eric Hodel
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining
6
+ # a copy of this software and associated documentation files (the
7
+ # "Software"), to deal in the Software without restriction, including
8
+ # without limitation the rights to use, copy, modify, merge, publish,
9
+ # distribute, sublicense, and/or sell copies of the Software, and to
10
+ # permit persons to whom the Software is furnished to do so, subject to
11
+ # the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be
14
+ # included in all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
+ #++
24
+
25
+ begin
26
+ gem 'rdoc'
27
+ rescue Gem::LoadError
28
+ end unless defined?(RDoc)
29
+
30
+ begin
31
+ gem 'rake'
32
+ rescue Gem::LoadError
33
+ end unless defined?(Rake)
34
+
35
+ require_relative '../rdoc'
36
+ require 'rake'
37
+ require 'rake/tasklib'
38
+
39
+ ##
40
+ # RDoc::Task creates the following rake tasks to generate and clean up RDoc
41
+ # output:
42
+ #
43
+ # [rdoc]
44
+ # Main task for this RDoc task.
45
+ #
46
+ # [clobber_rdoc]
47
+ # Delete all the rdoc files. This target is automatically added to the main
48
+ # clobber target.
49
+ #
50
+ # [rerdoc]
51
+ # Rebuild the rdoc files from scratch, even if they are not out of date.
52
+ #
53
+ # [rdoc:coverage]
54
+ # Print RDoc coverage report for all rdoc files.
55
+ #
56
+ # Simple Example:
57
+ #
58
+ # require 'rdoc/task'
59
+ #
60
+ # RDoc::Task.new do |rdoc|
61
+ # rdoc.main = "README.md"
62
+ # rdoc.rdoc_files.include("README.md", "lib/**/*.rb")
63
+ # end
64
+ #
65
+ # The +rdoc+ object passed to the block is an RDoc::Task object. See the
66
+ # attributes list for the RDoc::Task class for available customization options.
67
+ #
68
+ # == Specifying different task names
69
+ #
70
+ # You may wish to give the task a different name, such as if you are
71
+ # generating two sets of documentation. For instance, if you want to have a
72
+ # development set of documentation including private methods:
73
+ #
74
+ # require 'rdoc/task'
75
+ #
76
+ # RDoc::Task.new :rdoc_dev do |rdoc|
77
+ # rdoc.main = "README.md"
78
+ # rdoc.rdoc_files.include("README.md", "lib/**/*.rb")
79
+ # rdoc.options << "--all"
80
+ # end
81
+ #
82
+ # The tasks would then be named :<em>rdoc_dev</em>,
83
+ # :clobber_<em>rdoc_dev</em>, and :re<em>rdoc_dev</em>.
84
+ #
85
+ # If you wish to have completely different task names, then pass a Hash as
86
+ # first argument. With the <tt>:rdoc</tt>, <tt>:clobber_rdoc</tt> and
87
+ # <tt>:rerdoc</tt> options, you can customize the task names to your liking.
88
+ #
89
+ # For example:
90
+ #
91
+ # require 'rdoc/task'
92
+ #
93
+ # RDoc::Task.new(:rdoc => "rdoc", :clobber_rdoc => "rdoc:clean",
94
+ # :rerdoc => "rdoc:force")
95
+ #
96
+ # This will create the tasks <tt>:rdoc</tt>, <tt>:rdoc:clean</tt>,
97
+ # <tt>:rdoc:force</tt>, and <tt>:rdoc:coverage</tt>.
98
+
99
+ class RDoc::Task < Rake::TaskLib
100
+
101
+ ##
102
+ # Name of the main, top level task. (default is :rdoc)
103
+
104
+ attr_accessor :name
105
+
106
+ ##
107
+ # The markup format; one of: +rdoc+ (the default), +markdown+, +rd+, +tomdoc+.
108
+ # See {Markup Formats}[rdoc-ref:RDoc::Markup@Markup+Formats].
109
+ attr_accessor :markup
110
+
111
+ ##
112
+ # Name of directory to receive the html output files. (default is "html")
113
+
114
+ attr_accessor :rdoc_dir
115
+
116
+ ##
117
+ # Title of RDoc documentation. (defaults to rdoc's default)
118
+
119
+ attr_accessor :title
120
+
121
+ ##
122
+ # Name of file to be used as the main, top level file of the RDoc. (default
123
+ # is none)
124
+
125
+ attr_accessor :main
126
+
127
+ ##
128
+ # Name of template to be used by rdoc. (defaults to rdoc's default)
129
+
130
+ attr_accessor :template
131
+
132
+ ##
133
+ # Name of format generator (<tt>--format</tt>) used by rdoc. (defaults to
134
+ # rdoc's default)
135
+
136
+ attr_accessor :generator
137
+
138
+ ##
139
+ # List of files to be included in the rdoc generation. (default is [])
140
+
141
+ attr_accessor :rdoc_files
142
+
143
+ ##
144
+ # Additional list of options to be passed rdoc. (default is [])
145
+
146
+ attr_accessor :options
147
+
148
+ ##
149
+ # Whether to run the rdoc process as an external shell (default is false)
150
+
151
+ attr_accessor :external
152
+
153
+ ##
154
+ # Create an RDoc task with the given name. See the RDoc::Task class overview
155
+ # for documentation.
156
+
157
+ def initialize(name = :rdoc) # :yield: self
158
+ defaults
159
+
160
+ check_names name
161
+
162
+ @name = name
163
+
164
+ yield self if block_given?
165
+
166
+ define
167
+ end
168
+
169
+ ##
170
+ # Ensures that +names+ only includes names for the :rdoc, :clobber_rdoc and
171
+ # :rerdoc. If other names are given an ArgumentError is raised.
172
+
173
+ def check_names(names)
174
+ return unless Hash === names
175
+
176
+ invalid_options =
177
+ names.keys.map { |k| k.to_sym } - [:rdoc, :clobber_rdoc, :rerdoc]
178
+
179
+ unless invalid_options.empty? then
180
+ raise ArgumentError, "invalid options: #{invalid_options.join ', '}"
181
+ end
182
+ end
183
+
184
+ ##
185
+ # Task description for the clobber rdoc task or its renamed equivalent
186
+
187
+ def clobber_task_description
188
+ "Remove RDoc HTML files"
189
+ end
190
+
191
+ ##
192
+ # Sets default task values
193
+
194
+ def defaults
195
+ @name = :rdoc
196
+ @rdoc_files = Rake::FileList.new
197
+ @rdoc_dir = 'html'
198
+ @main = nil
199
+ @title = nil
200
+ @template = nil
201
+ @generator = nil
202
+ @options = []
203
+ end
204
+
205
+ ##
206
+ # Create the tasks defined by this task lib.
207
+
208
+ def define
209
+ desc rdoc_task_description
210
+ task rdoc_task_name
211
+
212
+ desc rerdoc_task_description
213
+ task rerdoc_task_name => [clobber_task_name, rdoc_task_name]
214
+
215
+ desc clobber_task_description
216
+ task clobber_task_name do
217
+ rm_r @rdoc_dir rescue nil
218
+ end
219
+
220
+ task :clobber => [clobber_task_name]
221
+
222
+ directory @rdoc_dir
223
+
224
+ rdoc_target_deps = [
225
+ @rdoc_files,
226
+ Rake.application.rakefile
227
+ ].flatten.compact
228
+
229
+ task rdoc_task_name => [rdoc_target]
230
+ file rdoc_target => rdoc_target_deps do
231
+ @before_running_rdoc.call if @before_running_rdoc
232
+ args = option_list + @rdoc_files
233
+
234
+ $stderr.puts "rdoc #{args.join ' '}" if Rake.application.options.trace
235
+ RDoc::RDoc.new.document args
236
+ end
237
+
238
+ namespace rdoc_task_name do
239
+ desc coverage_task_description
240
+ task coverage_task_name do
241
+ @before_running_rdoc.call if @before_running_rdoc
242
+ opts = option_list << "-C"
243
+ args = opts + @rdoc_files
244
+
245
+ $stderr.puts "rdoc #{args.join ' '}" if Rake.application.options.trace
246
+ RDoc::RDoc.new.document args
247
+ end
248
+
249
+ desc server_task_description
250
+ task "server" do
251
+ @before_running_rdoc.call if @before_running_rdoc
252
+ args = option_list + ["--server"] + @rdoc_files
253
+
254
+ $stderr.puts "rdoc #{args.join ' '}" if Rake.application.options.trace
255
+ RDoc::RDoc.new.document args
256
+ end
257
+ end
258
+
259
+ self
260
+ end
261
+
262
+ ##
263
+ # List of options that will be supplied to RDoc
264
+
265
+ def option_list
266
+ result = @options.dup
267
+ result << "-o" << @rdoc_dir
268
+ result << "--main" << main if main
269
+ result << "--markup" << markup if markup
270
+ result << "--title" << title if title
271
+ result << "-T" << template if template
272
+ result << '-f' << generator if generator
273
+ result
274
+ end
275
+
276
+ ##
277
+ # The block passed to this method will be called just before running the
278
+ # RDoc generator. It is allowed to modify RDoc::Task attributes inside the
279
+ # block.
280
+
281
+ def before_running_rdoc(&block)
282
+ @before_running_rdoc = block
283
+ end
284
+
285
+ ##
286
+ # Task description for the rdoc task or its renamed equivalent
287
+
288
+ def rdoc_task_description
289
+ 'Build RDoc HTML files'
290
+ end
291
+
292
+ ##
293
+ # Task description for the rerdoc task or its renamed description
294
+
295
+ def rerdoc_task_description
296
+ "Rebuild RDoc HTML files"
297
+ end
298
+
299
+ ##
300
+ # Task description for the coverage task or its renamed description
301
+
302
+ def coverage_task_description
303
+ "Print RDoc coverage report"
304
+ end
305
+
306
+ ##
307
+ # Task description for the server task
308
+
309
+ def server_task_description
310
+ "Start a live-reloading documentation server"
311
+ end
312
+
313
+ private
314
+
315
+ def rdoc_target
316
+ "#{rdoc_dir}/created.rid"
317
+ end
318
+
319
+ def rdoc_task_name
320
+ case name
321
+ when Hash then (name[:rdoc] || "rdoc").to_s
322
+ else name.to_s
323
+ end
324
+ end
325
+
326
+ def clobber_task_name
327
+ case name
328
+ when Hash then (name[:clobber_rdoc] || "clobber_rdoc").to_s
329
+ else "clobber_#{name}"
330
+ end
331
+ end
332
+
333
+ def rerdoc_task_name
334
+ case name
335
+ when Hash then (name[:rerdoc] || "rerdoc").to_s
336
+ else "re#{name}"
337
+ end
338
+ end
339
+
340
+ def coverage_task_name
341
+ "coverage"
342
+ end
343
+
344
+ end
345
+
346
+ # :stopdoc:
347
+ module Rake
348
+
349
+ ##
350
+ # For backwards compatibility
351
+
352
+ RDocTask = RDoc::Task # :nodoc:
353
+
354
+ end
355
+ # :startdoc:
@@ -0,0 +1,244 @@
1
+ # frozen_string_literal: true
2
+
3
+ ##
4
+ # For RDoc::Text#to_html
5
+
6
+ require 'strscan'
7
+
8
+ ##
9
+ # Methods for manipulating comment text
10
+
11
+ module RDoc::Text
12
+
13
+ ##
14
+ # The language for this text. This affects stripping comments
15
+ # markers.
16
+
17
+ attr_accessor :language
18
+
19
+ ##
20
+ # Maps markup formats to classes that can parse them. If the format is
21
+ # unknown, "rdoc" format is used.
22
+
23
+ MARKUP_FORMAT = {
24
+ 'markdown' => RDoc::Markdown,
25
+ 'rdoc' => RDoc::Markup,
26
+ 'rd' => RDoc::RD,
27
+ 'tomdoc' => RDoc::TomDoc,
28
+ }
29
+
30
+ MARKUP_FORMAT.default = RDoc::Markup
31
+
32
+ ##
33
+ # Expands tab characters in +text+ to eight spaces
34
+
35
+ module_function def expand_tabs(text)
36
+ expanded = []
37
+
38
+ text.each_line do |line|
39
+ nil while line.gsub!(/(?:\G|\r)((?:.{8})*?)([^\t\r\n]{0,7})\t/) do
40
+ r = "#{$1}#{$2}#{' ' * (8 - $2.size)}"
41
+ r = RDoc::Encoding.change_encoding r, text.encoding
42
+ r
43
+ end
44
+
45
+ expanded << line
46
+ end
47
+
48
+ expanded.join
49
+ end
50
+
51
+ ##
52
+ # Flush +text+ left based on the shortest line
53
+
54
+ def flush_left(text)
55
+ indent = 9999
56
+
57
+ text.each_line do |line|
58
+ line_indent = line =~ /\S/ || 9999
59
+ indent = line_indent if indent > line_indent
60
+ end
61
+
62
+ empty = ''
63
+ empty = RDoc::Encoding.change_encoding empty, text.encoding
64
+
65
+ text.gsub(/^ {0,#{indent}}/, empty)
66
+ end
67
+
68
+ ##
69
+ # Convert a string in markup format into HTML.
70
+ #
71
+ # Requires the including class to implement #formatter
72
+
73
+ def markup(text)
74
+ if @store.options
75
+ locale = @store.options.locale
76
+ else
77
+ locale = nil
78
+ end
79
+ if locale
80
+ i18n_text = RDoc::I18n::Text.new(text)
81
+ text = i18n_text.translate(locale)
82
+ end
83
+ parse(text).accept formatter
84
+ end
85
+
86
+ ##
87
+ # Strips hashes, expands tabs then flushes +text+ to the left
88
+
89
+ def normalize_comment(text)
90
+ return text if text.empty?
91
+
92
+ case language
93
+ when :ruby
94
+ text = strip_hashes text
95
+ when :c
96
+ text = strip_stars text
97
+ end
98
+ text = expand_tabs text
99
+ text = flush_left text
100
+ text = strip_newlines text
101
+ text
102
+ end
103
+
104
+ ##
105
+ # Normalizes +text+ then builds a RDoc::Markup::Document from it
106
+
107
+ def parse(text, format = 'rdoc')
108
+ return text if RDoc::Markup::Document === text
109
+ return text.parse if RDoc::Comment === text
110
+
111
+ text = normalize_comment text # TODO remove, should not be necessary
112
+
113
+ return RDoc::Markup::Document.new if text =~ /\A\n*\z/
114
+
115
+ MARKUP_FORMAT[format].parse text
116
+ end
117
+
118
+ ##
119
+ # The first +limit+ characters of +text+ as HTML
120
+
121
+ def snippet(text, limit = 100)
122
+ document = parse text
123
+
124
+ RDoc::Markup::ToHtmlSnippet.new(limit).convert document
125
+ end
126
+
127
+ ##
128
+ # Strips leading # characters from +text+
129
+
130
+ def strip_hashes(text)
131
+ return text if text =~ /^(?>\s*)[^\#]/
132
+
133
+ empty = ''
134
+ empty = RDoc::Encoding.change_encoding empty, text.encoding
135
+
136
+ text.gsub(/^\s*(#+)/) { $1.tr '#', ' ' }.gsub(/^\s+$/, empty)
137
+ end
138
+
139
+ ##
140
+ # Strips leading and trailing \n characters from +text+
141
+
142
+ def strip_newlines(text)
143
+ text.gsub(/\A\n*(.*?)\n*\z/m) do $1 end # block preserves String encoding
144
+ end
145
+
146
+ ##
147
+ # Strips /* */ style comments
148
+
149
+ def strip_stars(text)
150
+ return text unless text =~ %r%/\*.*\*/%m
151
+
152
+ encoding = text.encoding
153
+
154
+ text = text.gsub %r%Document-method:\s+[\w:.#=!?|^&<>~+\-/*\%@`\[\]]+%, ''
155
+
156
+ space = ' '
157
+ space = RDoc::Encoding.change_encoding space, encoding if encoding
158
+
159
+ text.sub! %r%/\*+% do space * $&.length end
160
+ text.sub! %r%\*+/% do space * $&.length end
161
+ text.gsub! %r%^[ \t]*\*%m do space * $&.length end
162
+
163
+ empty = ''
164
+ empty = RDoc::Encoding.change_encoding empty, encoding if encoding
165
+ text.gsub(/^\s+$/, empty)
166
+ end
167
+
168
+ ##
169
+ # Wraps +txt+ to +line_len+
170
+
171
+ def wrap(txt, line_len = 76)
172
+ res = []
173
+ sp = 0
174
+ ep = txt.length
175
+
176
+ while sp < ep
177
+ # scan back for a space
178
+ p = sp + line_len - 1
179
+ if p >= ep
180
+ p = ep
181
+ else
182
+ while p > sp and txt[p] != ?\s
183
+ p -= 1
184
+ end
185
+ if p <= sp
186
+ p = sp + line_len
187
+ while p < ep and txt[p] != ?\s
188
+ p += 1
189
+ end
190
+ end
191
+ end
192
+ res << txt[sp...p] << "\n"
193
+ sp = p
194
+ sp += 1 while sp < ep and txt[sp] == ?\s
195
+ end
196
+
197
+ res.join.strip
198
+ end
199
+
200
+ ##
201
+ # Character class to be separated by a space when concatenating
202
+ # lines.
203
+
204
+ SPACE_SEPARATED_LETTER_CLASS = /[\p{Nd}\p{Lc}\p{Pc}]|[!-~&&\W]/
205
+
206
+ ##
207
+ # Converts +text+ to a GitHub-style anchor ID:
208
+ # - Lowercase
209
+ # - Remove characters that aren't alphanumeric, space, or hyphen
210
+ # - Replace spaces with hyphens
211
+ #
212
+ # Examples:
213
+ # "Hello World" -> "hello-world"
214
+ # "Foo::Bar" -> "foobar"
215
+ # "What's New?" -> "whats-new"
216
+
217
+ module_function def to_anchor(text)
218
+ text.downcase.gsub(/[^a-z0-9 \-]/, '').gsub(' ', '-')
219
+ end
220
+
221
+ ##
222
+ # Decodes a label that may be in legacy RDoc format where CGI.escape was
223
+ # applied and then '%' was replaced with '-'. Converts '+' to space,
224
+ # then reverses -XX hex encoding for non-alphanumeric characters.
225
+ #
226
+ # Labels in new format pass through unchanged because -XX patterns that
227
+ # decode to alphanumeric characters are left as-is (CGI.escape never
228
+ # encodes alphanumerics).
229
+ #
230
+ # Examples:
231
+ # "What-27s+Here" -> "What's Here" (legacy: -27 is apostrophe)
232
+ # "Foo-3A-3ABar" -> "Foo::Bar" (legacy: -3A is colon)
233
+ # "Whats-Here" -> "Whats-Here" (new format, unchanged)
234
+
235
+ module_function def decode_legacy_label(label)
236
+ label = label.tr('+', ' ')
237
+ label.gsub!(/-([0-7][0-9A-F])/) do
238
+ char = [$1.hex].pack('C')
239
+ char.match?(/[a-zA-Z0-9]/) ? $& : char
240
+ end
241
+ label
242
+ end
243
+
244
+ end
@@ -0,0 +1,104 @@
1
+ # frozen_string_literal: true
2
+
3
+ ##
4
+ # A TokenStream is a list of tokens, gathered during the parse of some entity
5
+ # (say a method). Entities populate these streams by being registered with the
6
+ # lexer. Any class can collect tokens by including TokenStream. From the
7
+ # outside, you use such an object by calling the start_collecting_tokens
8
+ # method, followed by calls to add_token and pop_token.
9
+
10
+ module RDoc::TokenStream
11
+
12
+ ##
13
+ # Converts +token_stream+ to HTML wrapping various tokens with
14
+ # <tt><span></tt> elements. Some tokens types are wrapped in spans
15
+ # with the given class names. Other token types are not wrapped in spans.
16
+
17
+ def self.to_html(token_stream)
18
+ token_stream.map do |t|
19
+ next unless t
20
+
21
+ style = case t[:kind]
22
+ when :operator then 'ruby-operator'
23
+ when :keyword then 'ruby-keyword'
24
+ when :constant then 'ruby-constant'
25
+ when :ivar then 'ruby-ivar'
26
+ when :comment then 'ruby-comment'
27
+ when :value then 'ruby-value'
28
+ when :string then 'ruby-string'
29
+ when :symbol then 'ruby-value'
30
+ when :x_string then 'ruby-string'
31
+ when :regexp then 'ruby-regexp'
32
+ when :identifier then 'ruby-identifier'
33
+ end
34
+
35
+ text = t[:text]
36
+
37
+ text = CGI.escapeHTML text
38
+
39
+ if style then
40
+ end_with_newline = text.end_with?("\n")
41
+ text = text.chomp if end_with_newline
42
+ "<span class=\"#{style}\">#{text}</span>#{"\n" if end_with_newline}"
43
+ else
44
+ text
45
+ end
46
+ end.join
47
+ end
48
+
49
+ ##
50
+ # Adds +tokens+ to the collected tokens
51
+
52
+ def add_tokens(tokens)
53
+ @token_stream.concat(tokens)
54
+ end
55
+
56
+ ##
57
+ # Adds one +token+ to the collected tokens
58
+
59
+ def add_token(token)
60
+ @token_stream.push(token)
61
+ end
62
+
63
+ ##
64
+ # Starts collecting tokens
65
+ #
66
+
67
+ def collect_tokens(language)
68
+ @token_stream = []
69
+ @token_stream_language = language
70
+ end
71
+
72
+ alias start_collecting_tokens collect_tokens
73
+
74
+ ##
75
+ # Remove the last token from the collected tokens
76
+
77
+ def pop_token
78
+ @token_stream.pop
79
+ end
80
+
81
+ ##
82
+ # Current token stream
83
+
84
+ def token_stream
85
+ @token_stream
86
+ end
87
+
88
+ ##
89
+ # Returns a string representation of the token stream
90
+
91
+ def tokens_to_s
92
+ (token_stream or return '').compact.map { |token| token[:text] }.join ''
93
+ end
94
+
95
+ ##
96
+ # Returns the source language of the token stream as a string
97
+ #
98
+ # Returns 'c' or 'ruby'
99
+
100
+ def source_language
101
+ @token_stream_language == :c ? 'c' : 'ruby'
102
+ end
103
+
104
+ end