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,22 @@
1
+ <body role="document" class="file has-toc">
2
+ <%= render '_icons.rhtml' %>
3
+ <%= render '_header.rhtml' %>
4
+ <%= render '_sidebar_toggle.rhtml' %>
5
+
6
+ <nav id="sidebar-navigation" role="navigation" hidden>
7
+ <%= render '_sidebar_pages.rhtml' %>
8
+ <%= render '_sidebar_classes.rhtml' %>
9
+ </nav>
10
+
11
+ <main role="main">
12
+ <%- if @main_page %>
13
+ <%= @main_page.description %>
14
+ <%- else %>
15
+ <p>This is the API documentation for <%= h @title %>.</p>
16
+ <%- end %>
17
+ </main>
18
+
19
+ <%= render '_aside_toc.rhtml' %>
20
+
21
+ <%= render '_footer.rhtml' %>
22
+ </body>
@@ -0,0 +1,513 @@
1
+ 'use strict';
2
+
3
+ /* ===== Method Source Code Toggling ===== */
4
+
5
+ function showSource(e) {
6
+ let target = e.target;
7
+ while (!target.classList.contains('method-detail')) {
8
+ target = target.parentNode;
9
+ }
10
+ if (typeof target !== "undefined" && target !== null) {
11
+ target = target.querySelector('.method-source-code');
12
+ }
13
+ if (typeof target !== "undefined" && target !== null) {
14
+ target.classList.toggle('active-menu')
15
+ }
16
+ }
17
+
18
+ function hookSourceViews() {
19
+ document.querySelectorAll('.method-source-toggle').forEach((codeObject) => {
20
+ codeObject.addEventListener('click', showSource);
21
+ });
22
+ }
23
+
24
+ /* ===== Search Functionality ===== */
25
+
26
+ function createSearchInstance(input, result) {
27
+ if (!input || !result) return null;
28
+
29
+ result.classList.remove("initially-hidden");
30
+
31
+ const search = new SearchController(search_data, input, result);
32
+
33
+ search.renderItem = function(result) {
34
+ const li = document.createElement('li');
35
+ let html = '';
36
+
37
+ // TODO add relative path to <script> per-page
38
+ html += `<p class="search-match"><a href="${index_rel_prefix}${this.escapeHTML(result.path)}">${this.hlt(result.title)}`;
39
+ if (result.params)
40
+ html += `<span class="params">${result.params}</span>`;
41
+ html += '</a>';
42
+
43
+ // Add type indicator
44
+ if (result.type) {
45
+ const typeLabel = this.formatType(result.type);
46
+ const typeClass = result.type.replace(/_/g, '-');
47
+ html += `<span class="search-type search-type-${this.escapeHTML(typeClass)}">${typeLabel}</span>`;
48
+ }
49
+
50
+ if (result.snippet)
51
+ html += `<div class="search-snippet">${result.snippet}</div>`;
52
+
53
+ li.innerHTML = html;
54
+
55
+ return li;
56
+ }
57
+
58
+ search.formatType = function(type) {
59
+ const typeLabels = {
60
+ 'class': 'class',
61
+ 'module': 'module',
62
+ 'constant': 'const',
63
+ 'instance_method': 'method',
64
+ 'class_method': 'method'
65
+ };
66
+ return typeLabels[type] || type;
67
+ }
68
+
69
+ search.select = function(result) {
70
+ window.location.href = result.firstChild.firstChild.href;
71
+ }
72
+
73
+ return search;
74
+ }
75
+
76
+ function hookSearch() {
77
+ const input = document.querySelector('#search-field');
78
+ const result = document.querySelector('#search-results-desktop');
79
+
80
+ if (!input || !result) return; // Exit if search elements not found
81
+
82
+ const search_section = document.querySelector('#search-section');
83
+ if (search_section) {
84
+ search_section.classList.remove("initially-hidden");
85
+ }
86
+
87
+ const search = createSearchInstance(input, result);
88
+ if (!search) return;
89
+
90
+ // Hide search results when clicking outside the search area
91
+ document.addEventListener('click', (e) => {
92
+ if (!e.target.closest('.navbar-search-desktop')) {
93
+ search.hide();
94
+ }
95
+ });
96
+
97
+ // Hide search results on Escape key on desktop too
98
+ document.addEventListener('keydown', (e) => {
99
+ if (e.key === 'Escape' && input.matches(":focus")) {
100
+ search.hide();
101
+ input.blur();
102
+ }
103
+ });
104
+
105
+ // Show search results when focusing on input (if there's a query)
106
+ input.addEventListener('focus', () => {
107
+ if (input.value.trim()) {
108
+ search.show();
109
+ }
110
+ });
111
+
112
+ // Check for ?q= URL parameter and trigger search automatically
113
+ if (typeof URLSearchParams !== 'undefined') {
114
+ const urlParams = new URLSearchParams(window.location.search);
115
+ const queryParam = urlParams.get('q');
116
+ if (queryParam) {
117
+ input.value = queryParam;
118
+ search.search(queryParam, false);
119
+ }
120
+ }
121
+ }
122
+
123
+ /* ===== Keyboard Shortcuts ===== */
124
+
125
+ function hookFocus() {
126
+ document.addEventListener("keydown", (event) => {
127
+ if (document.activeElement.tagName === 'INPUT') {
128
+ return;
129
+ }
130
+ if (event.key === "/") {
131
+ event.preventDefault();
132
+ document.querySelector('#search-field').focus();
133
+ }
134
+ });
135
+ }
136
+
137
+ /* ===== Mobile Navigation ===== */
138
+
139
+ function hookSidebar() {
140
+ const sidebarNavigation = document.querySelector('#sidebar-navigation');
141
+ const sidebarNavigationToggle = document.querySelector('#sidebar-navigation-toggle');
142
+
143
+ if (!sidebarNavigation || !sidebarNavigationToggle) return;
144
+
145
+ const closeNav = () => {
146
+ sidebarNavigation.hidden = true;
147
+ sidebarNavigationToggle.ariaExpanded = 'false';
148
+ document.body.classList.remove('sidebar-navigation-open');
149
+ };
150
+
151
+ const openNav = () => {
152
+ sidebarNavigation.hidden = false;
153
+ sidebarNavigationToggle.ariaExpanded = 'true';
154
+ document.body.classList.add('sidebar-navigation-open');
155
+ };
156
+
157
+ const toggleNav = () => {
158
+ if (sidebarNavigation.hidden) {
159
+ openNav();
160
+ } else {
161
+ closeNav();
162
+ }
163
+ };
164
+
165
+ sidebarNavigationToggle.addEventListener('click', (e) => {
166
+ e.stopPropagation();
167
+ toggleNav();
168
+ });
169
+
170
+ const isSmallViewport = window.matchMedia("(max-width: 1023px)").matches;
171
+
172
+ // The sidebar is hidden by default with the `hidden` attribute
173
+ // On large viewports, we display the sidebar with JavaScript
174
+ // This is better than the opposite approach of hiding it with JavaScript
175
+ // because it avoids flickering the sidebar when the page is loaded, especially on mobile devices
176
+ if (isSmallViewport) {
177
+ closeNav();
178
+
179
+ // Close nav when clicking links inside it
180
+ document.addEventListener('click', (e) => {
181
+ if (e.target.closest('#sidebar-navigation a')) {
182
+ closeNav();
183
+ }
184
+ });
185
+
186
+ // Close nav when clicking backdrop
187
+ document.addEventListener('click', (e) => {
188
+ if (!sidebarNavigation.hidden &&
189
+ !e.target.closest('#sidebar-navigation') &&
190
+ !e.target.closest('#sidebar-navigation-toggle')) {
191
+ closeNav();
192
+ }
193
+ });
194
+ } else {
195
+ openNav();
196
+ }
197
+ }
198
+
199
+ /* ===== Right Sidebar Table of Contents ===== */
200
+
201
+ function generateToc() {
202
+ const tocNav = document.querySelector('#toc-nav');
203
+ if (!tocNav) return; // Exit if TOC nav doesn't exist
204
+
205
+ const main = document.querySelector('main');
206
+ if (!main) return;
207
+
208
+ // Find all h2 and h3 headings in the main content
209
+ const headings = main.querySelectorAll('h1, h2, h3');
210
+ if (headings.length === 0) return;
211
+
212
+ const tocList = document.createElement('ul');
213
+ tocList.className = 'toc-list';
214
+
215
+ headings.forEach((heading) => {
216
+ // Skip if heading doesn't have an id
217
+ if (!heading.id) return;
218
+
219
+ const li = document.createElement('li');
220
+ const level = heading.tagName.toLowerCase();
221
+ li.className = `toc-item toc-${level}`;
222
+
223
+ const link = document.createElement('a');
224
+ link.href = `#${heading.id}`;
225
+ link.className = 'toc-link';
226
+ link.textContent = heading.textContent.trim();
227
+ link.setAttribute('data-target', heading.id);
228
+
229
+ li.appendChild(link);
230
+ setHeadingScrollHandler(heading, link);
231
+ tocList.appendChild(li);
232
+ });
233
+
234
+ if (tocList.children.length > 0) {
235
+ tocNav.appendChild(tocList);
236
+ } else {
237
+ // Hide TOC if no headings found
238
+ const tocContainer = document.querySelector('#table-of-contents');
239
+ if (tocContainer) {
240
+ tocContainer.style.display = 'none';
241
+ }
242
+ }
243
+ }
244
+
245
+ function hookTocActiveHighlighting() {
246
+ const tocLinks = document.querySelectorAll('.toc-link');
247
+ const targetHeadings = [];
248
+ tocLinks.forEach((link) => {
249
+ const targetId = link.getAttribute('data-target');
250
+ const heading = document.getElementById(targetId);
251
+ if (heading) {
252
+ targetHeadings.push(heading);
253
+ }
254
+ });
255
+
256
+ if (targetHeadings.length === 0) return;
257
+
258
+ const observerOptions = {
259
+ root: null,
260
+ rootMargin: '0% 0px -35% 0px',
261
+ threshold: 0
262
+ };
263
+
264
+ const intersectingHeadings = new Set();
265
+ const update = () => {
266
+ const firstIntersectingHeading = targetHeadings.find((heading) => {
267
+ return intersectingHeadings.has(heading);
268
+ });
269
+ if (!firstIntersectingHeading) return;
270
+ const correspondingLink = document.querySelector(`.toc-link[data-target="${firstIntersectingHeading.id}"]`);
271
+ if (!correspondingLink) return;
272
+
273
+ // Remove active class from all links
274
+ tocLinks.forEach((link) => {
275
+ link.classList.remove('active');
276
+ });
277
+
278
+ // Add active class to current link
279
+ correspondingLink.classList.add('active');
280
+
281
+ // Scroll link into view if needed
282
+ const tocNav = document.querySelector('#toc-nav');
283
+ if (tocNav) {
284
+ const linkRect = correspondingLink.getBoundingClientRect();
285
+ const navRect = tocNav.getBoundingClientRect();
286
+
287
+ if (linkRect.top < navRect.top || linkRect.bottom > navRect.bottom) {
288
+ correspondingLink.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
289
+ }
290
+ }
291
+ };
292
+ const observer = new IntersectionObserver((entries) => {
293
+ entries.forEach((entry) => {
294
+ if (entry.isIntersecting) {
295
+ intersectingHeadings.add(entry.target);
296
+ } else {
297
+ intersectingHeadings.delete(entry.target);
298
+ }
299
+ });
300
+ update();
301
+ }, observerOptions);
302
+
303
+ // Observe all headings that have corresponding TOC links
304
+ targetHeadings.forEach((heading) => {
305
+ observer.observe(heading);
306
+ });
307
+ }
308
+
309
+ function setHeadingScrollHandler(heading, link) {
310
+ // Smooth scroll to heading when clicking link
311
+ if (!heading.id) return;
312
+
313
+ link.addEventListener('click', (e) => {
314
+ e.preventDefault();
315
+ heading.scrollIntoView({ behavior: 'smooth', block: 'start' });
316
+ history.pushState(null, '', `#${heading.id}`);
317
+ });
318
+ }
319
+
320
+ function setHeadingSelfLinkScrollHandlers() {
321
+ // Clicking link inside heading scrolls smoothly to heading itself
322
+ const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
323
+ headings.forEach((heading) => {
324
+ if (!heading.id) return;
325
+
326
+ const link = heading.querySelector(`a[href^="#${heading.id}"]`);
327
+ if (link) setHeadingScrollHandler(heading, link);
328
+ })
329
+ }
330
+
331
+ /* ===== Mobile Search Modal ===== */
332
+
333
+ function hookSearchModal() {
334
+ const searchToggle = document.querySelector('#search-toggle');
335
+ const searchModal = document.querySelector('#search-modal');
336
+ const searchModalClose = document.querySelector('#search-modal-close');
337
+ const searchModalBackdrop = document.querySelector('.search-modal-backdrop');
338
+ const searchInput = document.querySelector('#search-field-mobile');
339
+ const searchResults = document.querySelector('#search-results-mobile');
340
+ const searchEmpty = document.querySelector('.search-modal-empty');
341
+
342
+ if (!searchToggle || !searchModal) return;
343
+
344
+ // Initialize search for mobile modal
345
+ const mobileSearch = createSearchInstance(searchInput, searchResults);
346
+ if (!mobileSearch) return;
347
+
348
+ // Hide empty state when there are results
349
+ const originalRenderItem = mobileSearch.renderItem;
350
+ mobileSearch.renderItem = function(result) {
351
+ if (searchEmpty) searchEmpty.style.display = 'none';
352
+ return originalRenderItem.call(this, result);
353
+ };
354
+
355
+ const openSearchModal = () => {
356
+ searchModal.hidden = false;
357
+ document.body.style.overflow = 'hidden';
358
+ // Focus input after animation
359
+ setTimeout(() => {
360
+ if (searchInput) searchInput.focus();
361
+ }, 100);
362
+ };
363
+
364
+ const closeSearchModal = () => {
365
+ searchModal.hidden = true;
366
+ document.body.style.overflow = '';
367
+ };
368
+
369
+ // Open on button click
370
+ searchToggle.addEventListener('click', openSearchModal);
371
+
372
+ // Close on close button click
373
+ if (searchModalClose) {
374
+ searchModalClose.addEventListener('click', closeSearchModal);
375
+ }
376
+
377
+ // Close on backdrop click
378
+ if (searchModalBackdrop) {
379
+ searchModalBackdrop.addEventListener('click', closeSearchModal);
380
+ }
381
+
382
+ // Close on Escape key
383
+ document.addEventListener('keydown', (e) => {
384
+ if (e.key === 'Escape' && !searchModal.hidden) {
385
+ closeSearchModal();
386
+ }
387
+ });
388
+
389
+ // Check for ?q= URL parameter on mobile and open modal
390
+ if (typeof URLSearchParams !== 'undefined') {
391
+ const urlParams = new URLSearchParams(window.location.search);
392
+ const queryParam = urlParams.get('q');
393
+ const isSmallViewport = window.matchMedia("(max-width: 1023px)").matches;
394
+
395
+ if (queryParam && isSmallViewport) {
396
+ openSearchModal();
397
+ searchInput.value = queryParam;
398
+ mobileSearch.search(queryParam, false);
399
+ }
400
+ }
401
+ }
402
+
403
+ /* ===== Code Block Copy Functionality ===== */
404
+
405
+ function createCopyButton() {
406
+ const button = document.createElement('button');
407
+ button.className = 'copy-code-button';
408
+ button.type = 'button';
409
+ button.setAttribute('aria-label', 'Copy code to clipboard');
410
+ button.setAttribute('title', 'Copy code');
411
+
412
+ // Create clipboard icon SVG
413
+ const clipboardIcon = `
414
+ <svg viewBox="0 0 24 24">
415
+ <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
416
+ <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
417
+ </svg>
418
+ `;
419
+
420
+ // Create checkmark icon SVG (for copied state)
421
+ const checkIcon = `
422
+ <svg viewBox="0 0 24 24">
423
+ <polyline points="20 6 9 17 4 12"></polyline>
424
+ </svg>
425
+ `;
426
+
427
+ button.innerHTML = clipboardIcon;
428
+ button.dataset.clipboardIcon = clipboardIcon;
429
+ button.dataset.checkIcon = checkIcon;
430
+
431
+ return button;
432
+ }
433
+
434
+ function wrapCodeBlocksWithCopyButton() {
435
+ // Copy buttons are generated dynamically rather than statically in rhtml templates because:
436
+ // - Code blocks are generated by RDoc's markup formatter (RDoc::Markup::ToHtml),
437
+ // not directly in rhtml templates
438
+ // - Modifying the formatter would require extending RDoc's core internals
439
+
440
+ // Target code examples and source code; skip type signature blocks
441
+ const preElements = document.querySelectorAll('main pre:not(.method-type-signature)');
442
+
443
+ preElements.forEach((pre) => {
444
+ // Skip if already wrapped
445
+ if (pre.parentElement.classList.contains('code-block-wrapper')) {
446
+ return;
447
+ }
448
+
449
+ // Create wrapper
450
+ const wrapper = document.createElement('div');
451
+ wrapper.className = 'code-block-wrapper';
452
+
453
+ // Insert wrapper before pre
454
+ pre.parentNode.insertBefore(wrapper, pre);
455
+
456
+ // Move pre into wrapper
457
+ wrapper.appendChild(pre);
458
+
459
+ // Create and add copy button
460
+ const copyButton = createCopyButton();
461
+ wrapper.appendChild(copyButton);
462
+
463
+ // Add click handler
464
+ copyButton.addEventListener('click', () => {
465
+ copyCodeToClipboard(pre, copyButton);
466
+ });
467
+ });
468
+ }
469
+
470
+ function copyCodeToClipboard(preElement, button) {
471
+ const code = preElement.textContent;
472
+
473
+ // Use the Clipboard API (supported by all modern browsers)
474
+ if (navigator.clipboard && navigator.clipboard.writeText) {
475
+ navigator.clipboard.writeText(code).then(() => {
476
+ showCopySuccess(button);
477
+ }).catch(() => {
478
+ alert('Failed to copy code.');
479
+ });
480
+ } else {
481
+ alert('Failed to copy code.');
482
+ }
483
+ }
484
+
485
+ function showCopySuccess(button) {
486
+ // Change icon to checkmark
487
+ button.innerHTML = button.dataset.checkIcon;
488
+ button.classList.add('copied');
489
+ button.setAttribute('aria-label', 'Copied!');
490
+ button.setAttribute('title', 'Copied!');
491
+
492
+ // Revert back after 2 seconds
493
+ setTimeout(() => {
494
+ button.innerHTML = button.dataset.clipboardIcon;
495
+ button.classList.remove('copied');
496
+ button.setAttribute('aria-label', 'Copy code to clipboard');
497
+ button.setAttribute('title', 'Copy code');
498
+ }, 2000);
499
+ }
500
+
501
+ /* ===== Initialization ===== */
502
+
503
+ document.addEventListener('DOMContentLoaded', () => {
504
+ hookSourceViews();
505
+ hookSearch();
506
+ hookFocus();
507
+ hookSidebar();
508
+ generateToc();
509
+ setHeadingSelfLinkScrollHandlers();
510
+ hookTocActiveHighlighting();
511
+ hookSearchModal();
512
+ wrapCodeBlocksWithCopyButton();
513
+ });
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Client-side shell syntax highlighter for RDoc
3
+ * Highlights: $ prompts, commands, options, strings, env vars, comments
4
+ */
5
+
6
+ (function() {
7
+ 'use strict';
8
+
9
+ function escapeHtml(text) {
10
+ return text
11
+ .replace(/&/g, '&amp;')
12
+ .replace(/</g, '&lt;')
13
+ .replace(/>/g, '&gt;')
14
+ .replace(/"/g, '&quot;')
15
+ .replace(/'/g, '&#39;');
16
+ }
17
+
18
+ function wrap(className, text) {
19
+ return '<span class="' + className + '">' + escapeHtml(text) + '</span>';
20
+ }
21
+
22
+ function highlightLine(line) {
23
+ if (line.trim() === '') return escapeHtml(line);
24
+
25
+ var result = '';
26
+ var i = 0;
27
+ var len = line.length;
28
+
29
+ // Preserve leading whitespace
30
+ while (i < len && (line[i] === ' ' || line[i] === '\t')) {
31
+ result += escapeHtml(line[i++]);
32
+ }
33
+
34
+ // Check for $ prompt ($ followed by space or end of line)
35
+ if (line[i] === '$' && (line[i + 1] === ' ' || line[i + 1] === undefined)) {
36
+ result += wrap('sh-prompt', '$');
37
+ i++;
38
+ }
39
+
40
+ // Check for # comment at start
41
+ if (line[i] === '#') {
42
+ return result + wrap('sh-comment', line.slice(i));
43
+ }
44
+
45
+ var seenCommand = false;
46
+ var afterSpace = true;
47
+
48
+ while (i < len) {
49
+ var ch = line[i];
50
+
51
+ // Whitespace
52
+ if (ch === ' ' || ch === '\t') {
53
+ result += escapeHtml(ch);
54
+ i++;
55
+ afterSpace = true;
56
+ continue;
57
+ }
58
+
59
+ // Comment after whitespace
60
+ if (ch === '#' && afterSpace) {
61
+ result += wrap('sh-comment', line.slice(i));
62
+ break;
63
+ }
64
+
65
+ // Double-quoted string
66
+ if (ch === '"') {
67
+ var end = i + 1;
68
+ while (end < len && line[end] !== '"') {
69
+ if (line[end] === '\\' && end + 1 < len) end += 2;
70
+ else end++;
71
+ }
72
+ if (end < len) end++;
73
+ result += wrap('sh-string', line.slice(i, end));
74
+ i = end;
75
+ afterSpace = false;
76
+ continue;
77
+ }
78
+
79
+ // Single-quoted string
80
+ if (ch === "'") {
81
+ var end = i + 1;
82
+ while (end < len && line[end] !== "'") end++;
83
+ if (end < len) end++;
84
+ result += wrap('sh-string', line.slice(i, end));
85
+ i = end;
86
+ afterSpace = false;
87
+ continue;
88
+ }
89
+
90
+ // Environment variable (ALLCAPS=)
91
+ if (afterSpace && /[A-Z]/.test(ch)) {
92
+ var match = line.slice(i).match(/^[A-Z][A-Z0-9_]*=/);
93
+ if (match) {
94
+ result += wrap('sh-envvar', match[0]);
95
+ i += match[0].length;
96
+ // Read unquoted value
97
+ var valEnd = i;
98
+ while (valEnd < len && line[valEnd] !== ' ' && line[valEnd] !== '\t' && line[valEnd] !== '"' && line[valEnd] !== "'") valEnd++;
99
+ if (valEnd > i) {
100
+ result += escapeHtml(line.slice(i, valEnd));
101
+ i = valEnd;
102
+ }
103
+ afterSpace = false;
104
+ continue;
105
+ }
106
+ }
107
+
108
+ // Option (must be after whitespace)
109
+ if (ch === '-' && afterSpace) {
110
+ var match = line.slice(i).match(/^--?[a-zA-Z0-9_-]+(=[^"'\s]*)?/);
111
+ if (match) {
112
+ result += wrap('sh-option', match[0]);
113
+ i += match[0].length;
114
+ afterSpace = false;
115
+ continue;
116
+ }
117
+ }
118
+
119
+ // Command (first word: regular, ./path, ../path, ~/path, /abs/path, @scope/pkg)
120
+ if (!seenCommand && afterSpace) {
121
+ var isCmd = /[a-zA-Z0-9@~\/]/.test(ch) ||
122
+ (ch === '.' && (line[i + 1] === '/' || (line[i + 1] === '.' && line[i + 2] === '/')));
123
+ if (isCmd) {
124
+ var end = i;
125
+ while (end < len && line[end] !== ' ' && line[end] !== '\t') end++;
126
+ result += wrap('sh-command', line.slice(i, end));
127
+ i = end;
128
+ seenCommand = true;
129
+ afterSpace = false;
130
+ continue;
131
+ }
132
+ }
133
+
134
+ // Everything else
135
+ result += escapeHtml(ch);
136
+ i++;
137
+ afterSpace = false;
138
+ }
139
+
140
+ return result;
141
+ }
142
+
143
+ function highlightShell(code) {
144
+ return code.split('\n').map(highlightLine).join('\n');
145
+ }
146
+
147
+ function initHighlighting() {
148
+ var selectors = [
149
+ 'pre.bash', 'pre.sh', 'pre.shell', 'pre.console',
150
+ 'pre[data-language="bash"]', 'pre[data-language="sh"]',
151
+ 'pre[data-language="shell"]', 'pre[data-language="console"]'
152
+ ];
153
+
154
+ var blocks = document.querySelectorAll(selectors.join(', '));
155
+ blocks.forEach(function(block) {
156
+ if (block.getAttribute('data-highlighted') === 'true') return;
157
+ block.innerHTML = highlightShell(block.textContent);
158
+ block.setAttribute('data-highlighted', 'true');
159
+ });
160
+ }
161
+
162
+ if (document.readyState === 'loading') {
163
+ document.addEventListener('DOMContentLoaded', initHighlighting);
164
+ } else {
165
+ initHighlighting();
166
+ }
167
+ })();