docspring 3.0.0 → 3.1.0

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 (523) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/Gemfile.lock +4 -4
  4. data/README.md +11 -5
  5. data/docs/CreateHtmlSubmissionData.md +3 -1
  6. data/docs/CreatePdfSubmissionData.md +3 -1
  7. data/docs/PDFApi.md +156 -10
  8. data/docs/PublishVersionData.md +20 -0
  9. data/docs/RestoreVersionData.md +18 -0
  10. data/docs/Submission.md +4 -0
  11. data/docs/SubmissionPreview.md +4 -0
  12. data/docs/Template.md +15 -1
  13. data/docs/TemplateDeleteResponse.md +24 -0
  14. data/docs/TemplatePreview.md +13 -1
  15. data/docs/TemplatePublishVersionResponse.md +22 -0
  16. data/lib/docspring/api/pdf_api.rb +152 -5
  17. data/lib/docspring/api_client.rb +1 -1
  18. data/lib/docspring/models/combined_submission_action.rb +1 -5
  19. data/lib/docspring/models/create_html_submission_data.rb +13 -4
  20. data/lib/docspring/models/create_pdf_submission_data.rb +13 -4
  21. data/lib/docspring/models/publish_version_data.rb +230 -0
  22. data/lib/docspring/models/restore_version_data.rb +221 -0
  23. data/lib/docspring/models/submission.rb +41 -1
  24. data/lib/docspring/models/submission_data_request_event.rb +1 -5
  25. data/lib/docspring/models/submission_preview.rb +41 -1
  26. data/lib/docspring/models/template.rb +106 -4
  27. data/lib/docspring/models/template_delete_response.rb +287 -0
  28. data/lib/docspring/models/template_preview.rb +88 -4
  29. data/lib/docspring/models/template_publish_version_response.rb +282 -0
  30. data/lib/docspring/version.rb +1 -1
  31. data/lib/docspring.rb +4 -0
  32. data/spec/api/pdf_api_spec.rb +27 -2
  33. data/spec/models/create_html_submission_data_spec.rb +6 -0
  34. data/spec/models/create_pdf_submission_data_spec.rb +6 -0
  35. data/spec/models/publish_version_data_spec.rb +42 -0
  36. data/spec/models/restore_version_data_spec.rb +36 -0
  37. data/spec/models/submission_preview_spec.rb +16 -0
  38. data/spec/models/submission_spec.rb +16 -0
  39. data/spec/models/template_delete_response_spec.rb +58 -0
  40. data/spec/models/template_preview_spec.rb +40 -0
  41. data/spec/models/template_publish_version_response_spec.rb +52 -0
  42. data/spec/models/template_spec.rb +46 -0
  43. data/vendor/bundle/ruby/3.3.0/bin/irb +29 -0
  44. data/vendor/bundle/ruby/3.3.0/bin/rdbg +29 -0
  45. data/vendor/bundle/ruby/3.3.0/bin/rdoc +29 -0
  46. data/vendor/bundle/ruby/3.3.0/bin/ri +29 -0
  47. data/vendor/bundle/ruby/3.3.0/cache/ast-2.4.3.gem +0 -0
  48. data/vendor/bundle/ruby/3.3.0/cache/debug-1.10.0.gem +0 -0
  49. data/vendor/bundle/ruby/3.3.0/cache/io-console-0.8.0.gem +0 -0
  50. data/vendor/bundle/ruby/3.3.0/cache/irb-1.15.1.gem +0 -0
  51. data/vendor/bundle/ruby/3.3.0/cache/parser-3.3.7.2.gem +0 -0
  52. data/vendor/bundle/ruby/3.3.0/cache/pp-0.6.2.gem +0 -0
  53. data/vendor/bundle/ruby/3.3.0/cache/prettyprint-0.2.0.gem +0 -0
  54. data/vendor/bundle/ruby/3.3.0/cache/rdoc-6.12.0.gem +0 -0
  55. data/vendor/bundle/ruby/3.3.0/cache/reline-0.6.0.gem +0 -0
  56. data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/debug-1.10.0/debug/debug.bundle +0 -0
  57. data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/debug-1.10.0/gem.build_complete +0 -0
  58. data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/debug-1.10.0/gem_make.out +19 -0
  59. data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/io-console-0.8.0/gem.build_complete +0 -0
  60. data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/io-console-0.8.0/gem_make.out +31 -0
  61. data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/io-console-0.8.0/io/console.bundle +0 -0
  62. data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/io-console-0.8.0/mkmf.log +447 -0
  63. data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/LICENSE.MIT +20 -0
  64. data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/README.YARD.md +12 -0
  65. data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/lib/ast/node.rb +268 -0
  66. data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/lib/ast/processor/mixin.rb +288 -0
  67. data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/lib/ast/processor.rb +12 -0
  68. data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/lib/ast/sexp.rb +30 -0
  69. data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/lib/ast.rb +17 -0
  70. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/CONTRIBUTING.md +573 -0
  71. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/Gemfile +10 -0
  72. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/LICENSE.txt +22 -0
  73. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/README.md +970 -0
  74. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/Rakefile +57 -0
  75. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/TODO.md +23 -0
  76. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/debug.gemspec +33 -0
  77. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/exe/rdbg +53 -0
  78. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/ext/debug/Makefile +270 -0
  79. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/ext/debug/debug.c +228 -0
  80. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/ext/debug/debug_version.h +1 -0
  81. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/ext/debug/extconf.rb +27 -0
  82. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/ext/debug/iseq_collector.c +93 -0
  83. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/abbrev_command.rb +77 -0
  84. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/breakpoint.rb +556 -0
  85. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/client.rb +263 -0
  86. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/color.rb +123 -0
  87. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/config.rb +590 -0
  88. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/console.rb +213 -0
  89. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/dap_custom/traceInspector.rb +336 -0
  90. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/debug.bundle +0 -0
  91. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/frame_info.rb +188 -0
  92. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/irb_integration.rb +37 -0
  93. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/local.rb +115 -0
  94. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/open.rb +13 -0
  95. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/open_nonstop.rb +15 -0
  96. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/prelude.rb +50 -0
  97. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/server.rb +534 -0
  98. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/server_cdp.rb +1348 -0
  99. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/server_dap.rb +1108 -0
  100. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/session.rb +2659 -0
  101. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/source_repository.rb +150 -0
  102. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/start.rb +5 -0
  103. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/thread_client.rb +1455 -0
  104. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/tracer.rb +241 -0
  105. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/version.rb +5 -0
  106. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug.rb +9 -0
  107. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/misc/README.md.erb +636 -0
  108. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/.document +5 -0
  109. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/BSDL +22 -0
  110. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/COPYING +56 -0
  111. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/README.md +46 -0
  112. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/ext/io/console/Makefile +272 -0
  113. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/ext/io/console/console.c +1969 -0
  114. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/ext/io/console/extconf.rb +61 -0
  115. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/ext/io/console/win32_vk.inc +1390 -0
  116. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/lib/io/console/size.rb +23 -0
  117. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/lib/io/console.bundle +0 -0
  118. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/Gemfile +29 -0
  119. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/LICENSE.txt +22 -0
  120. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/README.md +125 -0
  121. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/Rakefile +52 -0
  122. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/bin/console +6 -0
  123. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/bin/setup +6 -0
  124. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/doc/irb/irb-tools.rd.ja +184 -0
  125. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/doc/irb/irb.rd.ja +425 -0
  126. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/exe/irb +9 -0
  127. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/irb.gemspec +46 -0
  128. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/cmd/nop.rb +4 -0
  129. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/color.rb +263 -0
  130. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/color_printer.rb +56 -0
  131. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/backtrace.rb +17 -0
  132. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/base.rb +60 -0
  133. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/break.rb +17 -0
  134. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/catch.rb +17 -0
  135. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/cd.rb +51 -0
  136. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/chws.rb +40 -0
  137. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/context.rb +16 -0
  138. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/continue.rb +17 -0
  139. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/copy.rb +73 -0
  140. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/debug.rb +73 -0
  141. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/delete.rb +17 -0
  142. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/disable_irb.rb +19 -0
  143. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/edit.rb +63 -0
  144. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/exit.rb +18 -0
  145. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/finish.rb +17 -0
  146. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/force_exit.rb +18 -0
  147. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/help.rb +83 -0
  148. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/history.rb +45 -0
  149. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/info.rb +17 -0
  150. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/internal_helpers.rb +27 -0
  151. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/irb_info.rb +33 -0
  152. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/load.rb +91 -0
  153. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/ls.rb +167 -0
  154. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/measure.rb +49 -0
  155. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/next.rb +17 -0
  156. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/pushws.rb +65 -0
  157. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/show_doc.rb +51 -0
  158. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/show_source.rb +74 -0
  159. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/step.rb +17 -0
  160. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/subirb.rb +123 -0
  161. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/whereami.rb +23 -0
  162. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command.rb +23 -0
  163. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/completion.rb +504 -0
  164. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/context.rb +751 -0
  165. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/debug/ui.rb +101 -0
  166. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/debug.rb +127 -0
  167. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/default_commands.rb +279 -0
  168. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/easter-egg.rb +152 -0
  169. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/change-ws.rb +37 -0
  170. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/eval_history.rb +149 -0
  171. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/loader.rb +127 -0
  172. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/multi-irb.rb +258 -0
  173. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/tracer.rb +39 -0
  174. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/use-loader.rb +67 -0
  175. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/workspaces.rb +36 -0
  176. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/frame.rb +80 -0
  177. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/help.rb +28 -0
  178. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/helper_method/base.rb +16 -0
  179. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/helper_method/conf.rb +11 -0
  180. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/helper_method.rb +29 -0
  181. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/history.rb +116 -0
  182. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/init.rb +540 -0
  183. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/input-method.rb +515 -0
  184. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/inspector.rb +136 -0
  185. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/lc/error.rb +52 -0
  186. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/lc/help-message +55 -0
  187. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/lc/ja/error.rb +53 -0
  188. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/lc/ja/help-message +58 -0
  189. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/locale.rb +153 -0
  190. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/nesting_parser.rb +239 -0
  191. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/notifier.rb +230 -0
  192. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/output-method.rb +80 -0
  193. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/pager.rb +213 -0
  194. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ruby-lex.rb +476 -0
  195. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ruby_logo.aa +118 -0
  196. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/source_finder.rb +138 -0
  197. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/statement.rb +101 -0
  198. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/version.rb +11 -0
  199. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/workspace.rb +171 -0
  200. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ws-for-case-2.rb +9 -0
  201. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/xmp.rb +164 -0
  202. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb.rb +736 -0
  203. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/man/irb.1 +292 -0
  204. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/LICENSE.txt +26 -0
  205. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/bin/ruby-parse +7 -0
  206. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/bin/ruby-rewrite +7 -0
  207. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/gauntlet_parser.rb +123 -0
  208. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/all.rb +17 -0
  209. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ast/node.rb +40 -0
  210. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ast/processor.rb +293 -0
  211. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/base.rb +291 -0
  212. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/builders/default.rb +2338 -0
  213. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/clobbering_error.rb +13 -0
  214. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/color.rb +32 -0
  215. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/context.rb +51 -0
  216. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/current.rb +137 -0
  217. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/current_arg_stack.rb +46 -0
  218. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/deprecation.rb +13 -0
  219. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/diagnostic/engine.rb +104 -0
  220. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/diagnostic.rb +163 -0
  221. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer/dedenter.rb +88 -0
  222. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer/explanation.rb +55 -0
  223. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer/literal.rb +284 -0
  224. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer/stack_state.rb +49 -0
  225. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer-F0.rb +12922 -0
  226. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer-F1.rb +14875 -0
  227. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer-strings.rb +5424 -0
  228. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/macruby.rb +9634 -0
  229. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/max_numparam_stack.rb +56 -0
  230. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/messages.rb +125 -0
  231. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/meta.rb +48 -0
  232. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/rewriter.rb +105 -0
  233. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby18.rb +9272 -0
  234. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby19.rb +9558 -0
  235. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby20.rb +10229 -0
  236. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby21.rb +10203 -0
  237. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby22.rb +10302 -0
  238. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby23.rb +10322 -0
  239. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby24.rb +10454 -0
  240. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby25.rb +10374 -0
  241. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby26.rb +10352 -0
  242. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby27.rb +11947 -0
  243. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby30.rb +12243 -0
  244. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby31.rb +12716 -0
  245. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby32.rb +12704 -0
  246. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby33.rb +12589 -0
  247. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby34.rb +12596 -0
  248. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/rubymotion.rb +9515 -0
  249. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/runner/ruby_parse.rb +157 -0
  250. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/runner/ruby_rewrite.rb +101 -0
  251. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/runner.rb +299 -0
  252. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/buffer.rb +369 -0
  253. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/comment/associator.rb +233 -0
  254. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/comment.rb +134 -0
  255. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/collection.rb +18 -0
  256. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/condition.rb +21 -0
  257. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/constant.rb +32 -0
  258. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/definition.rb +23 -0
  259. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/for.rb +19 -0
  260. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/heredoc.rb +19 -0
  261. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/index.rb +33 -0
  262. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/keyword.rb +20 -0
  263. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/method_definition.rb +25 -0
  264. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/objc_kwarg.rb +19 -0
  265. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/operator.rb +17 -0
  266. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/rescue_body.rb +21 -0
  267. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/send.rb +36 -0
  268. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/ternary.rb +18 -0
  269. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/variable.rb +31 -0
  270. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map.rb +186 -0
  271. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/range.rb +326 -0
  272. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/rewriter/action.rb +44 -0
  273. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/rewriter.rb +513 -0
  274. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/tree_rewriter/action.rb +243 -0
  275. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/tree_rewriter.rb +431 -0
  276. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/static_environment.rb +134 -0
  277. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/syntax_error.rb +21 -0
  278. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/tree_rewriter.rb +133 -0
  279. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/unknown_encoding_in_magic_comment_error.rb +15 -0
  280. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/variables_stack.rb +36 -0
  281. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/version.rb +5 -0
  282. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser.rb +91 -0
  283. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/parser.gemspec +43 -0
  284. data/vendor/bundle/ruby/3.3.0/gems/pp-0.6.2/BSDL +22 -0
  285. data/vendor/bundle/ruby/3.3.0/gems/pp-0.6.2/COPYING +56 -0
  286. data/vendor/bundle/ruby/3.3.0/gems/pp-0.6.2/lib/pp.rb +699 -0
  287. data/vendor/bundle/ruby/3.3.0/gems/pp-0.6.2/pp.gemspec +35 -0
  288. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/.github/dependabot.yml +6 -0
  289. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/.github/workflows/test.yml +41 -0
  290. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/.gitignore +8 -0
  291. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/Gemfile +4 -0
  292. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/LICENSE.txt +22 -0
  293. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/README.md +43 -0
  294. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/Rakefile +10 -0
  295. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/bin/console +14 -0
  296. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/bin/setup +8 -0
  297. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/lib/prettyprint.rb +558 -0
  298. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/prettyprint.gemspec +29 -0
  299. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/CONTRIBUTING.rdoc +219 -0
  300. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/CVE-2013-0256.rdoc +49 -0
  301. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/ExampleMarkdown.md +39 -0
  302. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/ExampleRDoc.rdoc +210 -0
  303. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/History.rdoc +1668 -0
  304. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/LEGAL.rdoc +50 -0
  305. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/LICENSE.rdoc +59 -0
  306. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/README.rdoc +142 -0
  307. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/RI.md +842 -0
  308. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/TODO.rdoc +60 -0
  309. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/exe/rdoc +43 -0
  310. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/exe/ri +12 -0
  311. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/alias.rb +111 -0
  312. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/anon_class.rb +10 -0
  313. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/any_method.rb +379 -0
  314. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/attr.rb +175 -0
  315. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/class_module.rb +871 -0
  316. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/constant.rb +186 -0
  317. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/context/section.rb +175 -0
  318. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/context.rb +1264 -0
  319. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/extend.rb +9 -0
  320. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/ghost_method.rb +6 -0
  321. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/include.rb +9 -0
  322. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/meta_method.rb +6 -0
  323. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/method_attr.rb +430 -0
  324. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/mixin.rb +120 -0
  325. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/normal_class.rb +92 -0
  326. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/normal_module.rb +73 -0
  327. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/require.rb +51 -0
  328. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/single_class.rb +30 -0
  329. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/top_level.rb +291 -0
  330. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object.rb +426 -0
  331. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_objects.rb +5 -0
  332. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/comment.rb +239 -0
  333. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/cross_reference.rb +228 -0
  334. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/encoding.rb +120 -0
  335. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/erb_partial.rb +18 -0
  336. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/erbio.rb +37 -0
  337. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/darkfish.rb +824 -0
  338. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/json_index.rb +300 -0
  339. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/markup.rb +159 -0
  340. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/pot/message_extractor.rb +68 -0
  341. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/pot/po.rb +84 -0
  342. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/pot/po_entry.rb +141 -0
  343. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/pot.rb +99 -0
  344. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/ri.rb +30 -0
  345. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_footer.rhtml +5 -0
  346. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_head.rhtml +43 -0
  347. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml +19 -0
  348. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +34 -0
  349. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +15 -0
  350. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +9 -0
  351. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +15 -0
  352. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +15 -0
  353. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +21 -0
  354. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml +11 -0
  355. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +32 -0
  356. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +6 -0
  357. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +14 -0
  358. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +11 -0
  359. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +39 -0
  360. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_toggle.rhtml +3 -0
  361. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/class.rhtml +206 -0
  362. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/css/fonts.css +167 -0
  363. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/css/rdoc.css +668 -0
  364. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf +0 -0
  365. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf +0 -0
  366. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf +0 -0
  367. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf +0 -0
  368. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf +0 -0
  369. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf +0 -0
  370. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/add.png +0 -0
  371. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/arrow_up.png +0 -0
  372. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/brick.png +0 -0
  373. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/brick_link.png +0 -0
  374. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/bug.png +0 -0
  375. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/bullet_black.png +0 -0
  376. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png +0 -0
  377. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png +0 -0
  378. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/date.png +0 -0
  379. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/delete.png +0 -0
  380. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/find.png +0 -0
  381. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif +0 -0
  382. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/macFFBgHack.png +0 -0
  383. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/package.png +0 -0
  384. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/page_green.png +0 -0
  385. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/page_white_text.png +0 -0
  386. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/page_white_width.png +0 -0
  387. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/plugin.png +0 -0
  388. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/ruby.png +0 -0
  389. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/tag_blue.png +0 -0
  390. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/tag_green.png +0 -0
  391. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/transparent.png +0 -0
  392. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/wrench.png +0 -0
  393. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/wrench_orange.png +0 -0
  394. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/zoom.png +0 -0
  395. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/index.rhtml +23 -0
  396. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/js/darkfish.js +120 -0
  397. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/js/search.js +110 -0
  398. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/page.rhtml +18 -0
  399. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +20 -0
  400. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +65 -0
  401. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +70 -0
  402. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/json_index/js/navigation.js +105 -0
  403. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/json_index/js/searcher.js +229 -0
  404. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator.rb +51 -0
  405. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/i18n/locale.rb +102 -0
  406. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/i18n/text.rb +126 -0
  407. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/i18n.rb +10 -0
  408. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/known_classes.rb +74 -0
  409. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markdown/entities.rb +2131 -0
  410. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markdown/literals.kpeg +21 -0
  411. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markdown/literals.rb +454 -0
  412. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markdown.kpeg +1244 -0
  413. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markdown.rb +16793 -0
  414. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/attr_changer.rb +22 -0
  415. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/attr_span.rb +35 -0
  416. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/attribute_manager.rb +405 -0
  417. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/attributes.rb +70 -0
  418. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/blank_line.rb +27 -0
  419. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/block_quote.rb +14 -0
  420. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/document.rb +164 -0
  421. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/formatter.rb +272 -0
  422. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/hard_break.rb +31 -0
  423. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/heading.rb +78 -0
  424. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/include.rb +42 -0
  425. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/indented_paragraph.rb +47 -0
  426. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/list.rb +101 -0
  427. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/list_item.rb +99 -0
  428. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/paragraph.rb +28 -0
  429. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/parser.rb +585 -0
  430. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/pre_process.rb +318 -0
  431. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/raw.rb +69 -0
  432. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/regexp_handling.rb +40 -0
  433. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/rule.rb +20 -0
  434. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/table.rb +56 -0
  435. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_ansi.rb +93 -0
  436. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_bs.rb +102 -0
  437. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_html.rb +452 -0
  438. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_html_crossref.rb +226 -0
  439. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_html_snippet.rb +287 -0
  440. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_joined_paragraph.rb +46 -0
  441. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_label.rb +74 -0
  442. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_markdown.rb +191 -0
  443. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_rdoc.rb +352 -0
  444. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_table_of_contents.rb +88 -0
  445. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_test.rb +69 -0
  446. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_tt_only.rb +120 -0
  447. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/verbatim.rb +83 -0
  448. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup.rb +240 -0
  449. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/options.rb +1397 -0
  450. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/c.rb +1260 -0
  451. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/changelog.rb +350 -0
  452. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/markdown.rb +22 -0
  453. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/prism_ruby.rb +1099 -0
  454. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/rd.rb +22 -0
  455. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/ripper_state_lex.rb +302 -0
  456. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/ruby.rb +2381 -0
  457. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/ruby_tools.rb +165 -0
  458. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/simple.rb +61 -0
  459. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/text.rb +11 -0
  460. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser.rb +297 -0
  461. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rd/block_parser.rb +1706 -0
  462. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rd/block_parser.ry +643 -0
  463. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rd/inline.rb +71 -0
  464. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rd/inline_parser.rb +1854 -0
  465. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rd/inline_parser.ry +593 -0
  466. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rd.rb +99 -0
  467. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rdoc.rb +566 -0
  468. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/ri/driver.rb +1558 -0
  469. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/ri/formatter.rb +6 -0
  470. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/ri/paths.rb +171 -0
  471. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/ri/store.rb +6 -0
  472. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/ri/task.rb +71 -0
  473. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/ri.rb +20 -0
  474. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rubygems_hook.rb +330 -0
  475. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/servlet.rb +451 -0
  476. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/stats/normal.rb +58 -0
  477. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/stats/quiet.rb +59 -0
  478. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/stats/verbose.rb +44 -0
  479. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/stats.rb +461 -0
  480. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/store.rb +1001 -0
  481. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/task.rb +354 -0
  482. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/text.rb +322 -0
  483. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/token_stream.rb +118 -0
  484. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/tom_doc.rb +257 -0
  485. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/version.rb +10 -0
  486. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc.rb +211 -0
  487. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rubygems_plugin.rb +23 -0
  488. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/man/ri.1 +247 -0
  489. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/BSDL +22 -0
  490. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/COPYING +56 -0
  491. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/README.md +94 -0
  492. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/config.rb +373 -0
  493. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/face.rb +199 -0
  494. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/history.rb +76 -0
  495. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/io/ansi.rb +325 -0
  496. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/io/dumb.rb +120 -0
  497. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/io/windows.rb +530 -0
  498. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/io.rb +55 -0
  499. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_actor/base.rb +37 -0
  500. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_actor/composite.rb +17 -0
  501. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_actor/emacs.rb +517 -0
  502. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_actor/vi_command.rb +518 -0
  503. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_actor/vi_insert.rb +517 -0
  504. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_actor.rb +8 -0
  505. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_stroke.rb +119 -0
  506. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/kill_ring.rb +125 -0
  507. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/line_editor.rb +2382 -0
  508. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/unicode/east_asian_width.rb +1267 -0
  509. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/unicode.rb +415 -0
  510. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/version.rb +3 -0
  511. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline.rb +519 -0
  512. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/license_of_rb-readline +25 -0
  513. data/vendor/bundle/ruby/3.3.0/plugins/rdoc_plugin.rb +1 -0
  514. data/vendor/bundle/ruby/3.3.0/specifications/ast-2.4.3.gemspec +29 -0
  515. data/vendor/bundle/ruby/3.3.0/specifications/debug-1.10.0.gemspec +32 -0
  516. data/vendor/bundle/ruby/3.3.0/specifications/io-console-0.8.0.gemspec +25 -0
  517. data/vendor/bundle/ruby/3.3.0/specifications/irb-1.15.1.gemspec +31 -0
  518. data/vendor/bundle/ruby/3.3.0/specifications/parser-3.3.7.2.gemspec +37 -0
  519. data/vendor/bundle/ruby/3.3.0/specifications/pp-0.6.2.gemspec +27 -0
  520. data/vendor/bundle/ruby/3.3.0/specifications/prettyprint-0.2.0.gemspec +23 -0
  521. data/vendor/bundle/ruby/3.3.0/specifications/rdoc-6.12.0.gemspec +31 -0
  522. data/vendor/bundle/ruby/3.3.0/specifications/reline-0.6.0.gemspec +26 -0
  523. metadata +499 -3
@@ -0,0 +1,1558 @@
1
+ # frozen_string_literal: true
2
+ require 'optparse'
3
+
4
+ require_relative '../../rdoc'
5
+
6
+ require_relative 'formatter' # For RubyGems backwards compatibility
7
+ # TODO: Fix weird documentation with `require_relative`
8
+
9
+ ##
10
+ # The RI driver implements the command-line ri tool.
11
+ #
12
+ # The driver supports:
13
+ # * loading RI data from:
14
+ # * Ruby's standard library
15
+ # * RubyGems
16
+ # * ~/.rdoc
17
+ # * A user-supplied directory
18
+ # * Paging output (uses RI_PAGER environment variable, PAGER environment
19
+ # variable or the less, more and pager programs)
20
+ # * Interactive mode with tab-completion
21
+ # * Abbreviated names (ri Zl shows Zlib documentation)
22
+ # * Colorized output
23
+ # * Merging output from multiple RI data sources
24
+
25
+ class RDoc::RI::Driver
26
+
27
+ ##
28
+ # Base Driver error class
29
+
30
+ class Error < RDoc::RI::Error; end
31
+
32
+ ##
33
+ # Raised when a name isn't found in the ri data stores
34
+
35
+ class NotFoundError < Error
36
+
37
+ def initialize(klass, suggestion_proc = nil) # :nodoc:
38
+ @klass = klass
39
+ @suggestion_proc = suggestion_proc
40
+ end
41
+
42
+ ##
43
+ # Name that wasn't found
44
+
45
+ def name
46
+ @klass
47
+ end
48
+
49
+ def message # :nodoc:
50
+ str = "Nothing known about #{@klass}"
51
+ suggestions = @suggestion_proc&.call
52
+ if suggestions and !suggestions.empty?
53
+ str += "\nDid you mean? #{suggestions.join("\n ")}"
54
+ end
55
+ str
56
+ end
57
+ end
58
+
59
+ ##
60
+ # Show all method documentation following a class or module
61
+
62
+ attr_accessor :show_all
63
+
64
+ ##
65
+ # An RDoc::RI::Store for each entry in the RI path
66
+
67
+ attr_accessor :stores
68
+
69
+ ##
70
+ # Controls the user of the pager vs $stdout
71
+
72
+ attr_accessor :use_stdout
73
+
74
+ ##
75
+ # Default options for ri
76
+
77
+ def self.default_options
78
+ options = {}
79
+ options[:interactive] = false
80
+ options[:profile] = false
81
+ options[:show_all] = false
82
+ options[:expand_refs] = true
83
+ options[:use_stdout] = !$stdout.tty?
84
+ options[:width] = 72
85
+
86
+ # By default all standard paths are used.
87
+ options[:use_system] = true
88
+ options[:use_site] = true
89
+ options[:use_home] = true
90
+ options[:use_gems] = true
91
+ options[:extra_doc_dirs] = []
92
+
93
+ return options
94
+ end
95
+
96
+ ##
97
+ # Dump +data_path+ using pp
98
+
99
+ def self.dump data_path
100
+ require 'pp'
101
+
102
+ File.open data_path, 'rb' do |io|
103
+ pp Marshal.load(io.read)
104
+ end
105
+ end
106
+
107
+ ##
108
+ # Parses +argv+ and returns a Hash of options
109
+
110
+ def self.process_args argv
111
+ options = default_options
112
+
113
+ opts = OptionParser.new do |opt|
114
+ opt.program_name = File.basename $0
115
+ opt.version = RDoc::VERSION
116
+ opt.release = nil
117
+ opt.summary_indent = ' ' * 4
118
+
119
+ opt.banner = <<-EOT
120
+ Usage: #{opt.program_name} [options] [name ...]
121
+
122
+ Where name can be:
123
+
124
+ Class | Module | Module::Class
125
+
126
+ Class::method | Class#method | Class.method | method
127
+
128
+ gem_name: | gem_name:README | gem_name:History
129
+
130
+ ruby: | ruby:NEWS | ruby:globals
131
+
132
+ All class names may be abbreviated to their minimum unambiguous form.
133
+ If a name is ambiguous, all valid options will be listed.
134
+
135
+ A '.' matches either class or instance methods, while #method
136
+ matches only instance and ::method matches only class methods.
137
+
138
+ README and other files may be displayed by prefixing them with the gem name
139
+ they're contained in. If the gem name is followed by a ':' all files in the
140
+ gem will be shown. The file name extension may be omitted where it is
141
+ unambiguous.
142
+
143
+ 'ruby' can be used as a pseudo gem name to display files from the Ruby
144
+ core documentation. Use 'ruby:' by itself to get a list of all available
145
+ core documentation files.
146
+
147
+ For example:
148
+
149
+ #{opt.program_name} Fil
150
+ #{opt.program_name} File
151
+ #{opt.program_name} File.new
152
+ #{opt.program_name} zip
153
+ #{opt.program_name} rdoc:README
154
+ #{opt.program_name} ruby:comments
155
+
156
+ Note that shell quoting or escaping may be required for method names
157
+ containing punctuation:
158
+
159
+ #{opt.program_name} 'Array.[]'
160
+ #{opt.program_name} compact\\!
161
+
162
+ To see the default directories #{opt.program_name} will search, run:
163
+
164
+ #{opt.program_name} --list-doc-dirs
165
+
166
+ Specifying the --system, --site, --home, --gems, or --doc-dir options
167
+ will limit ri to searching only the specified directories.
168
+
169
+ ri options may be set in the RI environment variable.
170
+
171
+ The ri pager can be set with the RI_PAGER environment variable
172
+ or the PAGER environment variable.
173
+ EOT
174
+
175
+ opt.separator nil
176
+ opt.separator "Options:"
177
+
178
+ opt.separator nil
179
+
180
+ opt.on("--[no-]interactive", "-i",
181
+ "In interactive mode you can repeatedly",
182
+ "look up methods with autocomplete.") do |interactive|
183
+ options[:interactive] = interactive
184
+ end
185
+
186
+ opt.separator nil
187
+
188
+ opt.on("--[no-]all", "-a",
189
+ "Show all documentation for a class or",
190
+ "module.") do |show_all|
191
+ options[:show_all] = show_all
192
+ end
193
+
194
+ opt.separator nil
195
+
196
+ opt.on("--[no-]list", "-l",
197
+ "List classes ri knows about.") do |list|
198
+ options[:list] = list
199
+ end
200
+
201
+ opt.separator nil
202
+
203
+ opt.on("--[no-]pager",
204
+ "Send output to a pager,",
205
+ "rather than directly to stdout.") do |use_pager|
206
+ options[:use_stdout] = !use_pager
207
+ end
208
+
209
+ opt.separator nil
210
+
211
+ opt.on("-T",
212
+ "Synonym for --no-pager.") do
213
+ options[:use_stdout] = true
214
+ end
215
+
216
+ opt.separator nil
217
+
218
+ opt.on("--width=WIDTH", "-w", OptionParser::DecimalInteger,
219
+ "Set the width of the output.") do |width|
220
+ options[:width] = width
221
+ end
222
+
223
+ opt.separator nil
224
+
225
+ opt.on("--server[=PORT]", Integer,
226
+ "Run RDoc server on the given port.",
227
+ "The default port is 8214.") do |port|
228
+ options[:server] = port || 8214
229
+ end
230
+
231
+ opt.separator nil
232
+
233
+ formatters = RDoc::Markup.constants.grep(/^To[A-Z][a-z]+$/).sort
234
+ formatters = formatters.sort.map do |formatter|
235
+ formatter.to_s.sub('To', '').downcase
236
+ end
237
+ formatters -= %w[html label test] # remove useless output formats
238
+
239
+ opt.on("--format=NAME", "-f",
240
+ "Use the selected formatter. The default",
241
+ "formatter is bs for paged output and ansi",
242
+ "otherwise. Valid formatters are:",
243
+ "#{formatters.join(', ')}.", formatters) do |value|
244
+ options[:formatter] = RDoc::Markup.const_get "To#{value.capitalize}"
245
+ end
246
+
247
+ opt.separator nil
248
+
249
+ opt.on("--[no-]expand-refs", "Expand rdoc-refs at the end of output") do |value|
250
+ options[:expand_refs] = value
251
+ end
252
+
253
+ opt.separator nil
254
+
255
+ opt.on("--help", "-h",
256
+ "Show help and exit.") do
257
+ puts opts
258
+ exit
259
+ end
260
+
261
+ opt.separator nil
262
+
263
+ opt.on("--version", "-v",
264
+ "Output version information and exit.") do
265
+ puts "#{opts.program_name} #{opts.version}"
266
+ exit
267
+ end
268
+
269
+ opt.separator nil
270
+ opt.separator "Data source options:"
271
+ opt.separator nil
272
+
273
+ opt.on("--[no-]list-doc-dirs",
274
+ "List the directories from which ri will",
275
+ "source documentation on stdout and exit.") do |list_doc_dirs|
276
+ options[:list_doc_dirs] = list_doc_dirs
277
+ end
278
+
279
+ opt.separator nil
280
+
281
+ opt.on("--doc-dir=DIRNAME", "-d", Array,
282
+ "List of directories from which to source",
283
+ "documentation in addition to the standard",
284
+ "directories. May be repeated.") do |value|
285
+ value.each do |dir|
286
+ unless File.directory? dir then
287
+ raise OptionParser::InvalidArgument, "#{dir} is not a directory"
288
+ end
289
+
290
+ options[:extra_doc_dirs] << File.expand_path(dir)
291
+ end
292
+ end
293
+
294
+ opt.separator nil
295
+
296
+ opt.on("--no-standard-docs",
297
+ "Do not include documentation from",
298
+ "the Ruby standard library, site_lib,",
299
+ "installed gems, or ~/.rdoc.",
300
+ "Use with --doc-dir.") do
301
+ options[:use_system] = false
302
+ options[:use_site] = false
303
+ options[:use_gems] = false
304
+ options[:use_home] = false
305
+ end
306
+
307
+ opt.separator nil
308
+
309
+ opt.on("--[no-]system",
310
+ "Include documentation from Ruby's",
311
+ "standard library. Defaults to true.") do |value|
312
+ options[:use_system] = value
313
+ end
314
+
315
+ opt.separator nil
316
+
317
+ opt.on("--[no-]site",
318
+ "Include documentation from libraries",
319
+ "installed in site_lib.",
320
+ "Defaults to true.") do |value|
321
+ options[:use_site] = value
322
+ end
323
+
324
+ opt.separator nil
325
+
326
+ opt.on("--[no-]gems",
327
+ "Include documentation from RubyGems.",
328
+ "Defaults to true.") do |value|
329
+ options[:use_gems] = value
330
+ end
331
+
332
+ opt.separator nil
333
+
334
+ opt.on("--[no-]home",
335
+ "Include documentation stored in ~/.rdoc.",
336
+ "Defaults to true.") do |value|
337
+ options[:use_home] = value
338
+ end
339
+
340
+ opt.separator nil
341
+ opt.separator "Debug options:"
342
+ opt.separator nil
343
+
344
+ opt.on("--[no-]profile",
345
+ "Run with the ruby profiler.") do |value|
346
+ options[:profile] = value
347
+ end
348
+
349
+ opt.separator nil
350
+
351
+ opt.on("--dump=CACHE",
352
+ "Dump data from an ri cache or data file.") do |value|
353
+ unless File.readable?(value)
354
+ abort "#{value.inspect} is not readable"
355
+ end
356
+
357
+ if File.directory?(value)
358
+ abort "#{value.inspect} is a directory"
359
+ end
360
+
361
+ options[:dump_path] = File.new(value)
362
+ end
363
+ end
364
+
365
+ argv = ENV['RI'].to_s.split(' ').concat argv
366
+
367
+ opts.parse! argv
368
+
369
+ options[:names] = argv
370
+
371
+ options[:use_stdout] ||= !$stdout.tty?
372
+ options[:use_stdout] ||= options[:interactive]
373
+ options[:width] ||= 72
374
+
375
+ options
376
+
377
+ rescue OptionParser::InvalidArgument, OptionParser::InvalidOption => e
378
+ puts opts
379
+ puts
380
+ puts e
381
+ exit 1
382
+ end
383
+
384
+ ##
385
+ # Runs the ri command line executable using +argv+
386
+
387
+ def self.run argv = ARGV
388
+ options = process_args argv
389
+
390
+ if options[:dump_path] then
391
+ dump options[:dump_path]
392
+ return
393
+ end
394
+
395
+ ri = new options
396
+ ri.run
397
+ end
398
+
399
+ ##
400
+ # Creates a new driver using +initial_options+ from ::process_args
401
+
402
+ def initialize initial_options = {}
403
+ @paging = false
404
+ @classes = nil
405
+
406
+ options = self.class.default_options.update(initial_options)
407
+
408
+ @formatter_klass = options[:formatter]
409
+
410
+ require 'profile' if options[:profile]
411
+
412
+ @names = options[:names]
413
+ @list = options[:list]
414
+
415
+ @doc_dirs = []
416
+ @stores = []
417
+
418
+ RDoc::RI::Paths.each(options[:use_system], options[:use_site],
419
+ options[:use_home], options[:use_gems],
420
+ *options[:extra_doc_dirs]) do |path, type|
421
+ @doc_dirs << path
422
+
423
+ store = RDoc::RI::Store.new path, type
424
+ store.load_cache
425
+ @stores << store
426
+ end
427
+
428
+ @list_doc_dirs = options[:list_doc_dirs]
429
+
430
+ @interactive = options[:interactive]
431
+ @server = options[:server]
432
+ @use_stdout = options[:use_stdout]
433
+ @show_all = options[:show_all]
434
+ @width = options[:width]
435
+ @expand_refs = options[:expand_refs]
436
+ end
437
+
438
+ ##
439
+ # Adds paths for undocumented classes +also_in+ to +out+
440
+
441
+ def add_also_in out, also_in
442
+ return if also_in.empty?
443
+
444
+ out << RDoc::Markup::Rule.new(1)
445
+ out << RDoc::Markup::Paragraph.new("Also found in:")
446
+
447
+ paths = RDoc::Markup::Verbatim.new
448
+ also_in.each do |store|
449
+ paths.parts.push store.friendly_path, "\n"
450
+ end
451
+ out << paths
452
+ end
453
+
454
+ ##
455
+ # Adds a class header to +out+ for class +name+ which is described in
456
+ # +classes+.
457
+
458
+ def add_class out, name, classes
459
+ heading = if classes.all? { |klass| klass.module? } then
460
+ name
461
+ else
462
+ superclass = classes.map do |klass|
463
+ klass.superclass unless klass.module?
464
+ end.compact.shift || 'Object'
465
+
466
+ superclass = superclass.full_name unless String === superclass
467
+
468
+ "#{name} < #{superclass}"
469
+ end
470
+
471
+ out << RDoc::Markup::Heading.new(1, heading)
472
+ out << RDoc::Markup::BlankLine.new
473
+ end
474
+
475
+ ##
476
+ # Adds "(from ...)" to +out+ for +store+
477
+
478
+ def add_from out, store
479
+ out << RDoc::Markup::Paragraph.new("(from #{store.friendly_path})")
480
+ end
481
+
482
+ ##
483
+ # Adds +extends+ to +out+
484
+
485
+ def add_extends out, extends
486
+ add_extension_modules out, 'Extended by', extends
487
+ end
488
+
489
+ ##
490
+ # Adds a list of +extensions+ to this module of the given +type+ to +out+.
491
+ # add_includes and add_extends call this, so you should use those directly.
492
+
493
+ def add_extension_modules out, type, extensions
494
+ return if extensions.empty?
495
+
496
+ out << RDoc::Markup::Rule.new(1)
497
+ out << RDoc::Markup::Heading.new(1, "#{type}:")
498
+
499
+ extensions.each do |modules, store|
500
+ if modules.length == 1 then
501
+ add_extension_modules_single out, store, modules.first
502
+ else
503
+ add_extension_modules_multiple out, store, modules
504
+ end
505
+ end
506
+ end
507
+
508
+ ##
509
+ # Renders multiple included +modules+ from +store+ to +out+.
510
+
511
+ def add_extension_modules_multiple out, store, modules # :nodoc:
512
+ out << RDoc::Markup::Paragraph.new("(from #{store.friendly_path})")
513
+
514
+ wout, with = modules.partition { |incl| incl.comment.empty? }
515
+
516
+ out << RDoc::Markup::BlankLine.new unless with.empty?
517
+
518
+ with.each do |incl|
519
+ out << RDoc::Markup::Paragraph.new(incl.name)
520
+ out << RDoc::Markup::BlankLine.new
521
+ out << incl.comment.parse
522
+ end
523
+
524
+ unless wout.empty? then
525
+ verb = RDoc::Markup::Verbatim.new
526
+
527
+ wout.each do |incl|
528
+ verb.push incl.name, "\n"
529
+ end
530
+
531
+ out << verb
532
+ end
533
+ end
534
+
535
+ ##
536
+ # Adds a single extension module +include+ from +store+ to +out+
537
+
538
+ def add_extension_modules_single out, store, include # :nodoc:
539
+ name = include.name
540
+ path = store.friendly_path
541
+ out << RDoc::Markup::Paragraph.new("#{name} (from #{path})")
542
+
543
+ if include.comment then
544
+ out << RDoc::Markup::BlankLine.new
545
+ out << include.comment.parse
546
+ end
547
+ end
548
+
549
+ ##
550
+ # Adds +includes+ to +out+
551
+
552
+ def add_includes out, includes
553
+ add_extension_modules out, 'Includes', includes
554
+ end
555
+
556
+ ##
557
+ # Looks up the method +name+ and adds it to +out+
558
+
559
+ def add_method out, name
560
+ filtered = lookup_method name
561
+ method_document out, name, filtered
562
+ end
563
+
564
+ ##
565
+ # Adds documentation for all methods in +klass+ to +out+
566
+
567
+ def add_method_documentation out, klass
568
+ klass.method_list.each do |method|
569
+ begin
570
+ add_method out, method.full_name
571
+ rescue NotFoundError
572
+ next
573
+ end
574
+ end
575
+ end
576
+
577
+ ##
578
+ # Adds a list of +methods+ to +out+ with a heading of +name+
579
+
580
+ def add_method_list out, methods, name
581
+ return if methods.empty?
582
+
583
+ out << RDoc::Markup::Heading.new(1, "#{name}:")
584
+ out << RDoc::Markup::BlankLine.new
585
+
586
+ if @use_stdout and !@interactive then
587
+ out.concat methods.map { |method|
588
+ RDoc::Markup::Verbatim.new method
589
+ }
590
+ else
591
+ out << RDoc::Markup::IndentedParagraph.new(2, methods.join(', '))
592
+ end
593
+
594
+ out << RDoc::Markup::BlankLine.new
595
+ end
596
+
597
+ ##
598
+ # Returns ancestor classes of +klass+
599
+
600
+ def ancestors_of klass
601
+ ancestors = []
602
+
603
+ unexamined = [klass]
604
+ seen = []
605
+
606
+ loop do
607
+ break if unexamined.empty?
608
+ current = unexamined.shift
609
+ seen << current
610
+
611
+ stores = classes[current]
612
+
613
+ next unless stores and not stores.empty?
614
+
615
+ klasses = stores.flat_map do |store|
616
+ store.ancestors[current] || []
617
+ end.uniq
618
+
619
+ klasses = klasses - seen
620
+
621
+ ancestors.concat klasses
622
+ unexamined.concat klasses
623
+ end
624
+
625
+ ancestors.reverse
626
+ end
627
+
628
+ ##
629
+ # For RubyGems backwards compatibility
630
+
631
+ def class_cache # :nodoc:
632
+ end
633
+
634
+ ##
635
+ # Builds a RDoc::Markup::Document from +found+, +klasess+ and +includes+
636
+
637
+ def class_document name, found, klasses, includes, extends
638
+ also_in = []
639
+
640
+ out = RDoc::Markup::Document.new
641
+
642
+ add_class out, name, klasses
643
+
644
+ add_includes out, includes
645
+ add_extends out, extends
646
+
647
+ found.each do |store, klass|
648
+ render_class out, store, klass, also_in
649
+ end
650
+
651
+ add_also_in out, also_in
652
+
653
+ expand_rdoc_refs_at_the_bottom(out)
654
+ out
655
+ end
656
+
657
+ ##
658
+ # Adds the class +comment+ to +out+.
659
+
660
+ def class_document_comment out, document # :nodoc:
661
+ unless document.empty? then
662
+ out << RDoc::Markup::Rule.new(1)
663
+
664
+ if document.merged? then
665
+ parts = document.parts
666
+ parts = parts.zip [RDoc::Markup::BlankLine.new] * parts.length
667
+ parts.flatten!
668
+ parts.pop
669
+
670
+ out.concat parts
671
+ else
672
+ out << comment
673
+ end
674
+ end
675
+ end
676
+
677
+ ##
678
+ # Adds the constants from +klass+ to the Document +out+.
679
+
680
+ def class_document_constants out, klass # :nodoc:
681
+ return if klass.constants.empty?
682
+
683
+ out << RDoc::Markup::Heading.new(1, "Constants:")
684
+ out << RDoc::Markup::BlankLine.new
685
+ list = RDoc::Markup::List.new :NOTE
686
+
687
+ constants = klass.constants.sort_by { |constant| constant.name }
688
+
689
+ list.items.concat constants.map { |constant|
690
+ parts = constant.comment.parse.parts
691
+ parts << RDoc::Markup::Paragraph.new('[not documented]') if
692
+ parts.empty?
693
+
694
+ RDoc::Markup::ListItem.new(constant.name, *parts)
695
+ }
696
+
697
+ out << list
698
+ out << RDoc::Markup::BlankLine.new
699
+ end
700
+
701
+ ##
702
+ # Hash mapping a known class or module to the stores it can be loaded from
703
+
704
+ def classes
705
+ return @classes if @classes
706
+
707
+ @classes = {}
708
+
709
+ @stores.each do |store|
710
+ store.cache[:modules].each do |mod|
711
+ # using default block causes searched-for modules to be added
712
+ @classes[mod] ||= []
713
+ @classes[mod] << store
714
+ end
715
+ end
716
+
717
+ @classes
718
+ end
719
+
720
+ ##
721
+ # Returns the stores wherein +name+ is found along with the classes,
722
+ # extends and includes that match it
723
+
724
+ def classes_and_includes_and_extends_for name
725
+ klasses = []
726
+ extends = []
727
+ includes = []
728
+
729
+ found = @stores.map do |store|
730
+ begin
731
+ klass = store.load_class name
732
+ klasses << klass
733
+ extends << [klass.extends, store] if klass.extends
734
+ includes << [klass.includes, store] if klass.includes
735
+ [store, klass]
736
+ rescue RDoc::Store::MissingFileError
737
+ end
738
+ end.compact
739
+
740
+ extends.reject! do |modules,| modules.empty? end
741
+ includes.reject! do |modules,| modules.empty? end
742
+
743
+ [found, klasses, includes, extends]
744
+ end
745
+
746
+ ##
747
+ # Completes +name+ based on the caches. For Readline
748
+
749
+ def complete name
750
+ completions = []
751
+
752
+ klass, selector, method = parse_name name
753
+
754
+ complete_klass name, klass, selector, method, completions
755
+ complete_method name, klass, selector, completions
756
+
757
+ completions.sort.uniq
758
+ end
759
+
760
+ def complete_klass name, klass, selector, method, completions # :nodoc:
761
+ klasses = classes.keys
762
+
763
+ # may need to include Foo when given Foo::
764
+ klass_name = method ? name : klass
765
+
766
+ if name !~ /#|\./ then
767
+ completions.replace klasses.grep(/^#{Regexp.escape klass_name}[^:]*$/)
768
+ completions.concat klasses.grep(/^#{Regexp.escape name}[^:]*$/) if
769
+ name =~ /::$/
770
+
771
+ completions << klass if classes.key? klass # to complete a method name
772
+ elsif selector then
773
+ completions << klass if classes.key? klass
774
+ elsif classes.key? klass_name then
775
+ completions << klass_name
776
+ end
777
+ end
778
+
779
+ def complete_method name, klass, selector, completions # :nodoc:
780
+ if completions.include? klass and name =~ /#|\.|::/ then
781
+ methods = list_methods_matching name
782
+
783
+ if not methods.empty? then
784
+ # remove Foo if given Foo:: and a method was found
785
+ completions.delete klass
786
+ elsif selector then
787
+ # replace Foo with Foo:: as given
788
+ completions.delete klass
789
+ completions << "#{klass}#{selector}"
790
+ end
791
+
792
+ completions.concat methods
793
+ end
794
+ end
795
+
796
+ ##
797
+ # Converts +document+ to text and writes it to the pager
798
+
799
+ def display document
800
+ page do |io|
801
+ f = formatter(io)
802
+ f.width = @width if @width and f.respond_to?(:width)
803
+ text = document.accept f
804
+
805
+ io.write text
806
+ end
807
+ end
808
+
809
+ ##
810
+ # Outputs formatted RI data for class +name+. Groups undocumented classes
811
+
812
+ def display_class name
813
+ return if name =~ /#|\./
814
+
815
+ found, klasses, includes, extends =
816
+ classes_and_includes_and_extends_for name
817
+
818
+ return if found.empty?
819
+
820
+ out = class_document name, found, klasses, includes, extends
821
+
822
+ display out
823
+ end
824
+
825
+ ##
826
+ # Outputs formatted RI data for method +name+
827
+
828
+ def display_method name
829
+ out = RDoc::Markup::Document.new
830
+
831
+ add_method out, name
832
+
833
+ expand_rdoc_refs_at_the_bottom(out)
834
+
835
+ display out
836
+ end
837
+
838
+ ##
839
+ # Outputs formatted RI data for the class or method +name+.
840
+ #
841
+ # Returns true if +name+ was found, false if it was not an alternative could
842
+ # be guessed, raises an error if +name+ couldn't be guessed.
843
+
844
+ def display_name name
845
+ if name =~ /\w:(\w|$)/ then
846
+ display_page name
847
+ return true
848
+ end
849
+
850
+ return true if display_class name
851
+
852
+ display_method name if name =~ /::|#|\./
853
+
854
+ true
855
+ rescue NotFoundError
856
+ matches = list_methods_matching name if name =~ /::|#|\./
857
+ matches = classes.keys.grep(/^#{Regexp.escape name}/) if matches.empty?
858
+
859
+ raise if matches.empty?
860
+
861
+ page do |io|
862
+ io.puts "#{name} not found, maybe you meant:"
863
+ io.puts
864
+ io.puts matches.sort.join("\n")
865
+ end
866
+
867
+ false
868
+ end
869
+
870
+ ##
871
+ # Displays each name in +name+
872
+
873
+ def display_names names
874
+ names.each do |name|
875
+ name = expand_name name
876
+
877
+ display_name name
878
+ end
879
+ end
880
+
881
+ ##
882
+ # Outputs formatted RI data for page +name+.
883
+
884
+ def display_page name
885
+ store_name, page_name = name.split ':', 2
886
+
887
+ store = @stores.find { |s| s.source == store_name }
888
+
889
+ return display_page_list store if page_name.empty?
890
+
891
+ pages = store.cache[:pages]
892
+
893
+ unless pages.include? page_name then
894
+ found_names = pages.select do |n|
895
+ n =~ /#{Regexp.escape page_name}\.[^.]+$/
896
+ end
897
+
898
+ if found_names.length.zero? then
899
+ return display_page_list store, pages
900
+ elsif found_names.length > 1 then
901
+ return display_page_list store, found_names, page_name
902
+ end
903
+
904
+ page_name = found_names.first
905
+ end
906
+
907
+ page = store.load_page page_name
908
+
909
+ display page.comment.parse
910
+ end
911
+
912
+ ##
913
+ # Outputs a formatted RI page list for the pages in +store+.
914
+
915
+ def display_page_list store, pages = store.cache[:pages], search = nil
916
+ out = RDoc::Markup::Document.new
917
+
918
+ title = if search then
919
+ "#{search} pages"
920
+ else
921
+ 'Pages'
922
+ end
923
+
924
+ out << RDoc::Markup::Heading.new(1, "#{title} in #{store.friendly_path}")
925
+ out << RDoc::Markup::BlankLine.new
926
+
927
+ list = RDoc::Markup::List.new(:BULLET)
928
+
929
+ pages.each do |page|
930
+ list << RDoc::Markup::Paragraph.new(page)
931
+ end
932
+
933
+ out << list
934
+
935
+ display out
936
+ end
937
+
938
+ def check_did_you_mean # :nodoc:
939
+ if defined? DidYouMean::SpellChecker
940
+ true
941
+ else
942
+ begin
943
+ require 'did_you_mean'
944
+ if defined? DidYouMean::SpellChecker
945
+ true
946
+ else
947
+ false
948
+ end
949
+ rescue LoadError
950
+ false
951
+ end
952
+ end
953
+ end
954
+
955
+ ##
956
+ # Expands abbreviated klass +klass+ into a fully-qualified class. "Zl::Da"
957
+ # will be expanded to Zlib::DataError.
958
+
959
+ def expand_class klass
960
+ class_names = classes.keys
961
+ ary = class_names.grep(Regexp.new("\\A#{klass.gsub(/(?=::|\z)/, '[^:]*')}\\z"))
962
+ if ary.length != 1 && ary.first != klass
963
+ if check_did_you_mean
964
+ suggestion_proc = -> { DidYouMean::SpellChecker.new(dictionary: class_names).correct(klass) }
965
+ raise NotFoundError.new(klass, suggestion_proc)
966
+ else
967
+ raise NotFoundError, klass
968
+ end
969
+ end
970
+ ary.first
971
+ end
972
+
973
+ ##
974
+ # Expands the class portion of +name+ into a fully-qualified class. See
975
+ # #expand_class.
976
+
977
+ def expand_name name
978
+ klass, selector, method = parse_name name
979
+
980
+ return [selector, method].join if klass.empty?
981
+
982
+ case selector
983
+ when ':' then
984
+ [find_store(klass), selector, method]
985
+ else
986
+ [expand_class(klass), selector, method]
987
+ end.join
988
+ end
989
+
990
+ ##
991
+ # Filters the methods in +found+ trying to find a match for +name+.
992
+
993
+ def filter_methods found, name
994
+ regexp = name_regexp name
995
+
996
+ filtered = found.find_all do |store, methods|
997
+ methods.any? { |method| method.full_name =~ regexp }
998
+ end
999
+
1000
+ return filtered unless filtered.empty?
1001
+
1002
+ found
1003
+ end
1004
+
1005
+ ##
1006
+ # Yields items matching +name+ including the store they were found in, the
1007
+ # class being searched for, the class they were found in (an ancestor) the
1008
+ # types of methods to look up (from #method_type), and the method name being
1009
+ # searched for
1010
+
1011
+ def find_methods name
1012
+ klass, selector, method = parse_name name
1013
+
1014
+ types = method_type selector
1015
+
1016
+ klasses = nil
1017
+ ambiguous = klass.empty?
1018
+
1019
+ if ambiguous then
1020
+ klasses = classes.keys
1021
+ else
1022
+ klasses = ancestors_of klass
1023
+ klasses.unshift klass
1024
+ end
1025
+
1026
+ methods = []
1027
+
1028
+ klasses.each do |ancestor|
1029
+ ancestors = classes[ancestor]
1030
+
1031
+ next unless ancestors
1032
+
1033
+ klass = ancestor if ambiguous
1034
+
1035
+ ancestors.each do |store|
1036
+ methods << [store, klass, ancestor, types, method]
1037
+ end
1038
+ end
1039
+
1040
+ methods = methods.sort_by do |_, k, a, _, m|
1041
+ [k, a, m].compact
1042
+ end
1043
+
1044
+ methods.each do |item|
1045
+ yield(*item) # :yields: store, klass, ancestor, types, method
1046
+ end
1047
+
1048
+ self
1049
+ end
1050
+
1051
+ ##
1052
+ # Finds a store that matches +name+ which can be the name of a gem, "ruby",
1053
+ # "home" or "site".
1054
+ #
1055
+ # See also RDoc::Store#source
1056
+
1057
+ def find_store name
1058
+ @stores.each do |store|
1059
+ source = store.source
1060
+
1061
+ return source if source == name
1062
+
1063
+ return source if
1064
+ store.type == :gem and source =~ /^#{Regexp.escape name}-\d/
1065
+ end
1066
+
1067
+ raise RDoc::RI::Driver::NotFoundError, name
1068
+ end
1069
+
1070
+ ##
1071
+ # Creates a new RDoc::Markup::Formatter. If a formatter is given with -f,
1072
+ # use it. If we're outputting to a pager, use bs, otherwise ansi.
1073
+
1074
+ def formatter(io)
1075
+ if @formatter_klass then
1076
+ @formatter_klass.new
1077
+ elsif paging? or !io.tty? then
1078
+ RDoc::Markup::ToBs.new
1079
+ else
1080
+ RDoc::Markup::ToAnsi.new
1081
+ end
1082
+ end
1083
+
1084
+ ##
1085
+ # Runs ri interactively using Readline if it is available.
1086
+
1087
+ def interactive
1088
+ puts "\nEnter the method name you want to look up."
1089
+
1090
+ begin
1091
+ require 'readline'
1092
+ rescue LoadError
1093
+ end
1094
+ if defined? Readline then
1095
+ Readline.completion_proc = method :complete
1096
+ puts "You can use tab to autocomplete."
1097
+ end
1098
+
1099
+ puts "Enter a blank line to exit.\n\n"
1100
+
1101
+ loop do
1102
+ name = if defined? Readline then
1103
+ Readline.readline ">> ", true
1104
+ else
1105
+ print ">> "
1106
+ $stdin.gets
1107
+ end
1108
+
1109
+ return if name.nil? or name.empty?
1110
+
1111
+ begin
1112
+ display_name expand_name(name.strip)
1113
+ rescue NotFoundError => e
1114
+ puts e.message
1115
+ end
1116
+ end
1117
+
1118
+ rescue Interrupt
1119
+ exit
1120
+ end
1121
+
1122
+ ##
1123
+ # Lists classes known to ri starting with +names+. If +names+ is empty all
1124
+ # known classes are shown.
1125
+
1126
+ def list_known_classes names = []
1127
+ classes = []
1128
+
1129
+ stores.each do |store|
1130
+ classes << store.module_names
1131
+ end
1132
+
1133
+ classes = classes.flatten.uniq.sort
1134
+
1135
+ unless names.empty? then
1136
+ filter = Regexp.union names.map { |name| /^#{name}/ }
1137
+
1138
+ classes = classes.grep filter
1139
+ end
1140
+
1141
+ page do |io|
1142
+ if paging? or io.tty? then
1143
+ if names.empty? then
1144
+ io.puts "Classes and Modules known to ri:"
1145
+ else
1146
+ io.puts "Classes and Modules starting with #{names.join ', '}:"
1147
+ end
1148
+ io.puts
1149
+ end
1150
+
1151
+ io.puts classes.join("\n")
1152
+ end
1153
+ end
1154
+
1155
+ ##
1156
+ # Returns an Array of methods matching +name+
1157
+
1158
+ def list_methods_matching name
1159
+ found = []
1160
+
1161
+ find_methods name do |store, klass, ancestor, types, method|
1162
+ if types == :instance or types == :both then
1163
+ methods = store.instance_methods[ancestor]
1164
+
1165
+ if methods then
1166
+ matches = methods.grep(/^#{Regexp.escape method.to_s}/)
1167
+
1168
+ matches = matches.map do |match|
1169
+ "#{klass}##{match}"
1170
+ end
1171
+
1172
+ found.concat matches
1173
+ end
1174
+ end
1175
+
1176
+ if types == :class or types == :both then
1177
+ methods = store.class_methods[ancestor]
1178
+
1179
+ next unless methods
1180
+ matches = methods.grep(/^#{Regexp.escape method.to_s}/)
1181
+
1182
+ matches = matches.map do |match|
1183
+ "#{klass}::#{match}"
1184
+ end
1185
+
1186
+ found.concat matches
1187
+ end
1188
+ end
1189
+
1190
+ found.uniq
1191
+ end
1192
+
1193
+ ##
1194
+ # Loads RI data for method +name+ on +klass+ from +store+. +type+ and
1195
+ # +cache+ indicate if it is a class or instance method.
1196
+
1197
+ def load_method store, cache, klass, type, name
1198
+ methods = store.public_send(cache)[klass]
1199
+
1200
+ return unless methods
1201
+
1202
+ method = methods.find do |method_name|
1203
+ method_name == name
1204
+ end
1205
+
1206
+ return unless method
1207
+
1208
+ store.load_method klass, "#{type}#{method}"
1209
+ rescue RDoc::Store::MissingFileError => e
1210
+ comment = RDoc::Comment.new("missing documentation at #{e.file}")
1211
+ comment.parse
1212
+
1213
+ method = RDoc::AnyMethod.new nil, name
1214
+ method.comment = comment
1215
+ method
1216
+ end
1217
+
1218
+ ##
1219
+ # Returns an Array of RI data for methods matching +name+
1220
+
1221
+ def load_methods_matching name
1222
+ found = []
1223
+
1224
+ find_methods name do |store, klass, ancestor, types, method|
1225
+ methods = []
1226
+
1227
+ methods << load_method(store, :class_methods, ancestor, '::', method) if
1228
+ [:class, :both].include? types
1229
+
1230
+ methods << load_method(store, :instance_methods, ancestor, '#', method) if
1231
+ [:instance, :both].include? types
1232
+
1233
+ found << [store, methods.compact]
1234
+ end
1235
+
1236
+ found.reject do |path, methods| methods.empty? end
1237
+ end
1238
+
1239
+ ##
1240
+ # Returns a filtered list of methods matching +name+
1241
+
1242
+ def lookup_method name
1243
+ found = load_methods_matching name
1244
+
1245
+ if found.empty?
1246
+ if check_did_you_mean
1247
+ methods = []
1248
+ _, _, method_name = parse_name name
1249
+ find_methods name do |store, klass, ancestor, types, method|
1250
+ methods.push(*store.class_methods[klass]) if [:class, :both].include? types
1251
+ methods.push(*store.instance_methods[klass]) if [:instance, :both].include? types
1252
+ end
1253
+ methods = methods.uniq
1254
+ suggestion_proc = -> { DidYouMean::SpellChecker.new(dictionary: methods).correct(method_name) }
1255
+ raise NotFoundError.new(name, suggestion_proc)
1256
+ else
1257
+ raise NotFoundError, name
1258
+ end
1259
+ end
1260
+
1261
+ filter_methods found, name
1262
+ end
1263
+
1264
+ ##
1265
+ # Builds a RDoc::Markup::Document from +found+, +klasses+ and +includes+
1266
+
1267
+ def method_document out, name, filtered
1268
+ out << RDoc::Markup::Heading.new(1, name)
1269
+ out << RDoc::Markup::BlankLine.new
1270
+
1271
+ filtered.each do |store, methods|
1272
+ methods.each do |method|
1273
+ render_method out, store, method, name
1274
+ end
1275
+ end
1276
+
1277
+ out
1278
+ end
1279
+
1280
+ ##
1281
+ # Returns the type of method (:both, :instance, :class) for +selector+
1282
+
1283
+ def method_type selector
1284
+ case selector
1285
+ when '.', nil then :both
1286
+ when '#' then :instance
1287
+ else :class
1288
+ end
1289
+ end
1290
+
1291
+ ##
1292
+ # Returns a regular expression for +name+ that will match an
1293
+ # RDoc::AnyMethod's name.
1294
+
1295
+ def name_regexp name
1296
+ klass, type, name = parse_name name
1297
+
1298
+ case type
1299
+ when '#', '::' then
1300
+ /^#{klass}#{type}#{Regexp.escape name}$/
1301
+ else
1302
+ /^#{klass}(#|::)#{Regexp.escape name}$/
1303
+ end
1304
+ end
1305
+
1306
+ ##
1307
+ # Paginates output through a pager program.
1308
+
1309
+ def page
1310
+ if pager = setup_pager then
1311
+ begin
1312
+ yield pager
1313
+ ensure
1314
+ pager.close
1315
+ end
1316
+ else
1317
+ yield $stdout
1318
+ end
1319
+ rescue Errno::EPIPE
1320
+ ensure
1321
+ @paging = false
1322
+ end
1323
+
1324
+ ##
1325
+ # Are we using a pager?
1326
+
1327
+ def paging?
1328
+ @paging
1329
+ end
1330
+
1331
+ ##
1332
+ # Extracts the class, selector and method name parts from +name+ like
1333
+ # Foo::Bar#baz.
1334
+ #
1335
+ # NOTE: Given Foo::Bar, Bar is considered a class even though it may be a
1336
+ # method
1337
+
1338
+ def parse_name name
1339
+ parts = name.split(/(::?|#|\.)/)
1340
+
1341
+ if parts.length == 1 then
1342
+ if parts.first =~ /^[a-z]|^([%&*+\/<>^`|~-]|\+@|-@|<<|<=>?|===?|=>|=~|>>|\[\]=?|~@)$/ then
1343
+ type = '.'
1344
+ meth = parts.pop
1345
+ else
1346
+ type = nil
1347
+ meth = nil
1348
+ end
1349
+ elsif parts.length == 2 or parts.last =~ /::|#|\./ then
1350
+ type = parts.pop
1351
+ meth = nil
1352
+ elsif parts[1] == ':' then
1353
+ klass = parts.shift
1354
+ type = parts.shift
1355
+ meth = parts.join
1356
+ elsif parts[-2] != '::' or parts.last !~ /^[A-Z]/ then
1357
+ meth = parts.pop
1358
+ type = parts.pop
1359
+ end
1360
+
1361
+ klass ||= parts.join
1362
+
1363
+ [klass, type, meth]
1364
+ end
1365
+
1366
+ ##
1367
+ # Renders the +klass+ from +store+ to +out+. If the klass has no
1368
+ # documentable items the class is added to +also_in+ instead.
1369
+
1370
+ def render_class out, store, klass, also_in # :nodoc:
1371
+ document = klass.comment.parse
1372
+ # TODO the store's cache should always return an empty Array
1373
+ class_methods = store.class_methods[klass.full_name] || []
1374
+ instance_methods = store.instance_methods[klass.full_name] || []
1375
+ attributes = store.attributes[klass.full_name] || []
1376
+
1377
+ if document.empty? and
1378
+ instance_methods.empty? and class_methods.empty? then
1379
+ also_in << store
1380
+ return
1381
+ end
1382
+
1383
+ add_from out, store
1384
+
1385
+ class_document_comment out, document
1386
+
1387
+ if class_methods or instance_methods or not klass.constants.empty? then
1388
+ out << RDoc::Markup::Rule.new(1)
1389
+ end
1390
+
1391
+ class_document_constants out, klass
1392
+
1393
+ add_method_list out, class_methods, 'Class methods'
1394
+ add_method_list out, instance_methods, 'Instance methods'
1395
+ add_method_list out, attributes, 'Attributes'
1396
+
1397
+ add_method_documentation out, klass if @show_all
1398
+ end
1399
+
1400
+ def render_method out, store, method, name # :nodoc:
1401
+ out << RDoc::Markup::Paragraph.new("(from #{store.friendly_path})")
1402
+
1403
+ unless name =~ /^#{Regexp.escape method.parent_name}/ then
1404
+ out << RDoc::Markup::Heading.new(3, "Implementation from #{method.parent_name}")
1405
+ end
1406
+
1407
+ out << RDoc::Markup::Rule.new(1)
1408
+
1409
+ render_method_arguments out, method.arglists
1410
+ render_method_superclass out, method
1411
+ if method.is_alias_for
1412
+ al = method.is_alias_for
1413
+ alias_for = store.load_method al.parent_name, "#{al.name_prefix}#{al.name}"
1414
+ render_method_comment out, method, alias_for
1415
+ else
1416
+ render_method_comment out, method
1417
+ end
1418
+ end
1419
+
1420
+ def render_method_arguments out, arglists # :nodoc:
1421
+ return unless arglists
1422
+
1423
+ arglists = arglists.chomp.split "\n"
1424
+ arglists = arglists.map { |line| line + "\n" }
1425
+ out << RDoc::Markup::Verbatim.new(*arglists)
1426
+ out << RDoc::Markup::Rule.new(1)
1427
+ end
1428
+
1429
+ def render_method_comment out, method, alias_for = nil# :nodoc:
1430
+ if alias_for
1431
+ unless method.comment.nil? or method.comment.empty?
1432
+ out << RDoc::Markup::BlankLine.new
1433
+ out << method.comment.parse
1434
+ end
1435
+ out << RDoc::Markup::BlankLine.new
1436
+ out << RDoc::Markup::Paragraph.new("(This method is an alias for #{alias_for.full_name}.)")
1437
+ out << RDoc::Markup::BlankLine.new
1438
+ out << alias_for.comment.parse
1439
+ out << RDoc::Markup::BlankLine.new
1440
+ else
1441
+ out << RDoc::Markup::BlankLine.new
1442
+ out << method.comment.parse
1443
+ out << RDoc::Markup::BlankLine.new
1444
+ end
1445
+ end
1446
+
1447
+ def render_method_superclass out, method # :nodoc:
1448
+ return unless
1449
+ method.respond_to?(:superclass_method) and method.superclass_method
1450
+
1451
+ out << RDoc::Markup::BlankLine.new
1452
+ out << RDoc::Markup::Heading.new(4, "(Uses superclass method #{method.superclass_method})")
1453
+ out << RDoc::Markup::Rule.new(1)
1454
+ end
1455
+
1456
+ ##
1457
+ # Looks up and displays ri data according to the options given.
1458
+
1459
+ def run
1460
+ if @list_doc_dirs then
1461
+ puts @doc_dirs
1462
+ elsif @list then
1463
+ list_known_classes @names
1464
+ elsif @server then
1465
+ start_server
1466
+ elsif @interactive or @names.empty? then
1467
+ interactive
1468
+ else
1469
+ display_names @names
1470
+ end
1471
+ rescue NotFoundError => e
1472
+ abort e.message
1473
+ end
1474
+
1475
+ ##
1476
+ # Sets up a pager program to pass output through. Tries the RI_PAGER and
1477
+ # PAGER environment variables followed by pager, less then more.
1478
+
1479
+ def setup_pager
1480
+ return if @use_stdout
1481
+
1482
+ pagers = [ENV['RI_PAGER'], ENV['PAGER'], 'pager', 'less', 'more']
1483
+
1484
+ require 'shellwords'
1485
+ pagers.compact.uniq.each do |pager|
1486
+ pager = Shellwords.split(pager)
1487
+ next if pager.empty?
1488
+
1489
+ io = IO.popen(pager, 'w') rescue next
1490
+ next if $? and $?.pid == io.pid and $?.exited? # pager didn't work
1491
+
1492
+ @paging = true
1493
+
1494
+ return io
1495
+ end
1496
+
1497
+ @use_stdout = true
1498
+
1499
+ nil
1500
+ end
1501
+
1502
+ ##
1503
+ # Starts a WEBrick server for ri.
1504
+
1505
+ def start_server
1506
+ begin
1507
+ require 'webrick'
1508
+ rescue LoadError
1509
+ abort "webrick is not found. You may need to `gem install webrick` to install webrick."
1510
+ end
1511
+
1512
+ server = WEBrick::HTTPServer.new :Port => @server
1513
+
1514
+ extra_doc_dirs = @stores.map {|s| s.type == :extra ? s.path : nil}.compact
1515
+
1516
+ server.mount '/', RDoc::Servlet, nil, extra_doc_dirs
1517
+
1518
+ trap 'INT' do server.shutdown end
1519
+ trap 'TERM' do server.shutdown end
1520
+
1521
+ server.start
1522
+ end
1523
+
1524
+ RDOC_REFS_REGEXP = /\[rdoc-ref:([\w.]+)(@.*)?\]/
1525
+
1526
+ def expand_rdoc_refs_at_the_bottom(out)
1527
+ return unless @expand_refs
1528
+
1529
+ extracted_rdoc_refs = []
1530
+
1531
+ out.each do |part|
1532
+ content = if part.respond_to?(:text)
1533
+ part.text
1534
+ else
1535
+ next
1536
+ end
1537
+
1538
+ rdoc_refs = content.scan(RDOC_REFS_REGEXP).uniq.map do |file_name, _anchor|
1539
+ file_name
1540
+ end
1541
+
1542
+ extracted_rdoc_refs.concat(rdoc_refs)
1543
+ end
1544
+
1545
+ found_pages = extracted_rdoc_refs.map do |ref|
1546
+ begin
1547
+ @stores.first.load_page(ref)
1548
+ rescue RDoc::Store::MissingFileError
1549
+ end
1550
+ end.compact
1551
+
1552
+ found_pages.each do |page|
1553
+ out << RDoc::Markup::Heading.new(4, "Expanded from #{page.full_name}")
1554
+ out << RDoc::Markup::BlankLine.new
1555
+ out << page.comment.parse
1556
+ end
1557
+ end
1558
+ end