hyper-pro-gem 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 (380) hide show
  1. checksums.yaml +7 -0
  2. data/hyper-pro-gem.gemspec +12 -0
  3. data/yard-0.9.44/CHANGELOG.md +983 -0
  4. data/yard-0.9.44/LEGAL +94 -0
  5. data/yard-0.9.44/LICENSE +22 -0
  6. data/yard-0.9.44/README.md +329 -0
  7. data/yard-0.9.44/bin/yard +13 -0
  8. data/yard-0.9.44/bin/yardoc +13 -0
  9. data/yard-0.9.44/bin/yri +13 -0
  10. data/yard-0.9.44/docs/CodeObjects.md +115 -0
  11. data/yard-0.9.44/docs/GettingStarted.md +705 -0
  12. data/yard-0.9.44/docs/Handlers.md +152 -0
  13. data/yard-0.9.44/docs/Overview.md +61 -0
  14. data/yard-0.9.44/docs/Parser.md +166 -0
  15. data/yard-0.9.44/docs/Tags.md +304 -0
  16. data/yard-0.9.44/docs/TagsArch.md +123 -0
  17. data/yard-0.9.44/docs/Templates.md +497 -0
  18. data/yard-0.9.44/docs/WhatsNew.md +1297 -0
  19. data/yard-0.9.44/docs/images/code-objects-class-diagram.png +0 -0
  20. data/yard-0.9.44/docs/images/handlers-class-diagram.png +0 -0
  21. data/yard-0.9.44/docs/images/overview-class-diagram.png +0 -0
  22. data/yard-0.9.44/docs/images/parser-class-diagram.png +0 -0
  23. data/yard-0.9.44/docs/images/tags-class-diagram.png +0 -0
  24. data/yard-0.9.44/docs/templates/default/fulldoc/html/full_list_tag.erb +9 -0
  25. data/yard-0.9.44/docs/templates/default/fulldoc/html/setup.rb +6 -0
  26. data/yard-0.9.44/docs/templates/default/layout/html/setup.rb +9 -0
  27. data/yard-0.9.44/docs/templates/default/layout/html/tag_list.erb +11 -0
  28. data/yard-0.9.44/docs/templates/default/yard_tags/html/list.erb +18 -0
  29. data/yard-0.9.44/docs/templates/default/yard_tags/html/setup.rb +26 -0
  30. data/yard-0.9.44/docs/templates/plugin.rb +70 -0
  31. data/yard-0.9.44/lib/rubygems_plugin.rb +9 -0
  32. data/yard-0.9.44/lib/yard/autoload.rb +328 -0
  33. data/yard-0.9.44/lib/yard/cli/command.rb +85 -0
  34. data/yard-0.9.44/lib/yard/cli/command_parser.rb +93 -0
  35. data/yard-0.9.44/lib/yard/cli/config.rb +198 -0
  36. data/yard-0.9.44/lib/yard/cli/diff.rb +278 -0
  37. data/yard-0.9.44/lib/yard/cli/display.rb +69 -0
  38. data/yard-0.9.44/lib/yard/cli/gems.rb +84 -0
  39. data/yard-0.9.44/lib/yard/cli/graph.rb +125 -0
  40. data/yard-0.9.44/lib/yard/cli/help.rb +20 -0
  41. data/yard-0.9.44/lib/yard/cli/i18n.rb +70 -0
  42. data/yard-0.9.44/lib/yard/cli/list.rb +23 -0
  43. data/yard-0.9.44/lib/yard/cli/markup_types.rb +32 -0
  44. data/yard-0.9.44/lib/yard/cli/server.rb +266 -0
  45. data/yard-0.9.44/lib/yard/cli/stats.rb +234 -0
  46. data/yard-0.9.44/lib/yard/cli/yardoc.rb +791 -0
  47. data/yard-0.9.44/lib/yard/cli/yardopts_command.rb +110 -0
  48. data/yard-0.9.44/lib/yard/cli/yri.rb +215 -0
  49. data/yard-0.9.44/lib/yard/code_objects/base.rb +626 -0
  50. data/yard-0.9.44/lib/yard/code_objects/class_object.rb +146 -0
  51. data/yard-0.9.44/lib/yard/code_objects/class_variable_object.rb +11 -0
  52. data/yard-0.9.44/lib/yard/code_objects/constant_object.rb +16 -0
  53. data/yard-0.9.44/lib/yard/code_objects/extended_method_object.rb +24 -0
  54. data/yard-0.9.44/lib/yard/code_objects/extra_file_object.rb +135 -0
  55. data/yard-0.9.44/lib/yard/code_objects/macro_object.rb +171 -0
  56. data/yard-0.9.44/lib/yard/code_objects/method_object.rb +196 -0
  57. data/yard-0.9.44/lib/yard/code_objects/module_object.rb +21 -0
  58. data/yard-0.9.44/lib/yard/code_objects/namespace_mapper.rb +141 -0
  59. data/yard-0.9.44/lib/yard/code_objects/namespace_object.rb +200 -0
  60. data/yard-0.9.44/lib/yard/code_objects/proxy.rb +245 -0
  61. data/yard-0.9.44/lib/yard/code_objects/root_object.rb +19 -0
  62. data/yard-0.9.44/lib/yard/config.rb +274 -0
  63. data/yard-0.9.44/lib/yard/core_ext/array.rb +16 -0
  64. data/yard-0.9.44/lib/yard/core_ext/file.rb +69 -0
  65. data/yard-0.9.44/lib/yard/core_ext/hash.rb +16 -0
  66. data/yard-0.9.44/lib/yard/core_ext/insertion.rb +63 -0
  67. data/yard-0.9.44/lib/yard/core_ext/module.rb +11 -0
  68. data/yard-0.9.44/lib/yard/core_ext/string.rb +68 -0
  69. data/yard-0.9.44/lib/yard/core_ext/symbol_hash.rb +75 -0
  70. data/yard-0.9.44/lib/yard/docstring.rb +386 -0
  71. data/yard-0.9.44/lib/yard/docstring_parser.rb +344 -0
  72. data/yard-0.9.44/lib/yard/gem_index.rb +29 -0
  73. data/yard-0.9.44/lib/yard/globals.rb +22 -0
  74. data/yard-0.9.44/lib/yard/handlers/base.rb +617 -0
  75. data/yard-0.9.44/lib/yard/handlers/c/alias_handler.rb +16 -0
  76. data/yard-0.9.44/lib/yard/handlers/c/attribute_handler.rb +13 -0
  77. data/yard-0.9.44/lib/yard/handlers/c/base.rb +164 -0
  78. data/yard-0.9.44/lib/yard/handlers/c/class_handler.rb +27 -0
  79. data/yard-0.9.44/lib/yard/handlers/c/constant_handler.rb +13 -0
  80. data/yard-0.9.44/lib/yard/handlers/c/handler_methods.rb +212 -0
  81. data/yard-0.9.44/lib/yard/handlers/c/init_handler.rb +20 -0
  82. data/yard-0.9.44/lib/yard/handlers/c/method_handler.rb +45 -0
  83. data/yard-0.9.44/lib/yard/handlers/c/mixin_handler.rb +21 -0
  84. data/yard-0.9.44/lib/yard/handlers/c/module_handler.rb +17 -0
  85. data/yard-0.9.44/lib/yard/handlers/c/override_comment_handler.rb +31 -0
  86. data/yard-0.9.44/lib/yard/handlers/c/path_handler.rb +11 -0
  87. data/yard-0.9.44/lib/yard/handlers/c/struct_handler.rb +13 -0
  88. data/yard-0.9.44/lib/yard/handlers/c/symbol_handler.rb +8 -0
  89. data/yard-0.9.44/lib/yard/handlers/common/method_handler.rb +19 -0
  90. data/yard-0.9.44/lib/yard/handlers/processor.rb +200 -0
  91. data/yard-0.9.44/lib/yard/handlers/rbs/attribute_handler.rb +79 -0
  92. data/yard-0.9.44/lib/yard/handlers/rbs/base.rb +38 -0
  93. data/yard-0.9.44/lib/yard/handlers/rbs/constant_handler.rb +18 -0
  94. data/yard-0.9.44/lib/yard/handlers/rbs/method_handler.rb +327 -0
  95. data/yard-0.9.44/lib/yard/handlers/rbs/mixin_handler.rb +20 -0
  96. data/yard-0.9.44/lib/yard/handlers/rbs/namespace_handler.rb +26 -0
  97. data/yard-0.9.44/lib/yard/handlers/ruby/alias_handler.rb +45 -0
  98. data/yard-0.9.44/lib/yard/handlers/ruby/attribute_handler.rb +90 -0
  99. data/yard-0.9.44/lib/yard/handlers/ruby/base.rb +165 -0
  100. data/yard-0.9.44/lib/yard/handlers/ruby/class_condition_handler.rb +92 -0
  101. data/yard-0.9.44/lib/yard/handlers/ruby/class_handler.rb +119 -0
  102. data/yard-0.9.44/lib/yard/handlers/ruby/class_variable_handler.rb +17 -0
  103. data/yard-0.9.44/lib/yard/handlers/ruby/comment_handler.rb +10 -0
  104. data/yard-0.9.44/lib/yard/handlers/ruby/constant_handler.rb +73 -0
  105. data/yard-0.9.44/lib/yard/handlers/ruby/decorator_handler_methods.rb +123 -0
  106. data/yard-0.9.44/lib/yard/handlers/ruby/dsl_handler.rb +15 -0
  107. data/yard-0.9.44/lib/yard/handlers/ruby/dsl_handler_methods.rb +96 -0
  108. data/yard-0.9.44/lib/yard/handlers/ruby/exception_handler.rb +27 -0
  109. data/yard-0.9.44/lib/yard/handlers/ruby/extend_handler.rb +22 -0
  110. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/alias_handler.rb +37 -0
  111. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/attribute_handler.rb +65 -0
  112. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/base.rb +245 -0
  113. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/class_condition_handler.rb +83 -0
  114. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/class_handler.rb +113 -0
  115. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/class_variable_handler.rb +15 -0
  116. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/comment_handler.rb +10 -0
  117. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/constant_handler.rb +29 -0
  118. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/dsl_handler.rb +17 -0
  119. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/exception_handler.rb +13 -0
  120. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/extend_handler.rb +21 -0
  121. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/method_handler.rb +90 -0
  122. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/mixin_handler.rb +39 -0
  123. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/module_function_handler.rb +19 -0
  124. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/module_handler.rb +12 -0
  125. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/private_class_method_handler.rb +22 -0
  126. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/private_constant_handler.rb +22 -0
  127. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/visibility_handler.rb +18 -0
  128. data/yard-0.9.44/lib/yard/handlers/ruby/legacy/yield_handler.rb +29 -0
  129. data/yard-0.9.44/lib/yard/handlers/ruby/method_condition_handler.rb +9 -0
  130. data/yard-0.9.44/lib/yard/handlers/ruby/method_handler.rb +104 -0
  131. data/yard-0.9.44/lib/yard/handlers/ruby/mixin_handler.rb +61 -0
  132. data/yard-0.9.44/lib/yard/handlers/ruby/module_function_handler.rb +39 -0
  133. data/yard-0.9.44/lib/yard/handlers/ruby/module_handler.rb +12 -0
  134. data/yard-0.9.44/lib/yard/handlers/ruby/private_class_method_handler.rb +14 -0
  135. data/yard-0.9.44/lib/yard/handlers/ruby/private_constant_handler.rb +43 -0
  136. data/yard-0.9.44/lib/yard/handlers/ruby/public_class_method_handler.rb +14 -0
  137. data/yard-0.9.44/lib/yard/handlers/ruby/struct_handler_methods.rb +143 -0
  138. data/yard-0.9.44/lib/yard/handlers/ruby/visibility_handler.rb +35 -0
  139. data/yard-0.9.44/lib/yard/handlers/ruby/yield_handler.rb +31 -0
  140. data/yard-0.9.44/lib/yard/i18n/locale.rb +67 -0
  141. data/yard-0.9.44/lib/yard/i18n/message.rb +57 -0
  142. data/yard-0.9.44/lib/yard/i18n/messages.rb +56 -0
  143. data/yard-0.9.44/lib/yard/i18n/po_parser.rb +61 -0
  144. data/yard-0.9.44/lib/yard/i18n/pot_generator.rb +290 -0
  145. data/yard-0.9.44/lib/yard/i18n/text.rb +173 -0
  146. data/yard-0.9.44/lib/yard/logging.rb +260 -0
  147. data/yard-0.9.44/lib/yard/open_struct.rb +67 -0
  148. data/yard-0.9.44/lib/yard/options.rb +217 -0
  149. data/yard-0.9.44/lib/yard/parser/base.rb +57 -0
  150. data/yard-0.9.44/lib/yard/parser/c/c_parser.rb +235 -0
  151. data/yard-0.9.44/lib/yard/parser/c/comment_parser.rb +134 -0
  152. data/yard-0.9.44/lib/yard/parser/c/statement.rb +66 -0
  153. data/yard-0.9.44/lib/yard/parser/rbs/rbs_parser.rb +325 -0
  154. data/yard-0.9.44/lib/yard/parser/rbs/statement.rb +75 -0
  155. data/yard-0.9.44/lib/yard/parser/ruby/ast_node.rb +559 -0
  156. data/yard-0.9.44/lib/yard/parser/ruby/legacy/irb/slex.rb +294 -0
  157. data/yard-0.9.44/lib/yard/parser/ruby/legacy/ruby_lex.rb +1360 -0
  158. data/yard-0.9.44/lib/yard/parser/ruby/legacy/ruby_parser.rb +32 -0
  159. data/yard-0.9.44/lib/yard/parser/ruby/legacy/statement.rb +68 -0
  160. data/yard-0.9.44/lib/yard/parser/ruby/legacy/statement_list.rb +394 -0
  161. data/yard-0.9.44/lib/yard/parser/ruby/legacy/token_list.rb +74 -0
  162. data/yard-0.9.44/lib/yard/parser/ruby/ruby_parser.rb +792 -0
  163. data/yard-0.9.44/lib/yard/parser/ruby/token_resolver.rb +158 -0
  164. data/yard-0.9.44/lib/yard/parser/source_parser.rb +526 -0
  165. data/yard-0.9.44/lib/yard/rake/yardoc_task.rb +81 -0
  166. data/yard-0.9.44/lib/yard/registry.rb +439 -0
  167. data/yard-0.9.44/lib/yard/registry_resolver.rb +225 -0
  168. data/yard-0.9.44/lib/yard/registry_store.rb +342 -0
  169. data/yard-0.9.44/lib/yard/rubygems/backports/LICENSE.txt +57 -0
  170. data/yard-0.9.44/lib/yard/rubygems/backports/MIT.txt +20 -0
  171. data/yard-0.9.44/lib/yard/rubygems/backports/gem.rb +10 -0
  172. data/yard-0.9.44/lib/yard/rubygems/backports/source_index.rb +365 -0
  173. data/yard-0.9.44/lib/yard/rubygems/backports.rb +10 -0
  174. data/yard-0.9.44/lib/yard/rubygems/doc_manager.rb +90 -0
  175. data/yard-0.9.44/lib/yard/rubygems/hook.rb +197 -0
  176. data/yard-0.9.44/lib/yard/rubygems/specification.rb +50 -0
  177. data/yard-0.9.44/lib/yard/serializers/base.rb +83 -0
  178. data/yard-0.9.44/lib/yard/serializers/file_system_serializer.rb +123 -0
  179. data/yard-0.9.44/lib/yard/serializers/process_serializer.rb +24 -0
  180. data/yard-0.9.44/lib/yard/serializers/stdout_serializer.rb +34 -0
  181. data/yard-0.9.44/lib/yard/serializers/yardoc_serializer.rb +152 -0
  182. data/yard-0.9.44/lib/yard/server/adapter.rb +100 -0
  183. data/yard-0.9.44/lib/yard/server/commands/base.rb +203 -0
  184. data/yard-0.9.44/lib/yard/server/commands/display_file_command.rb +29 -0
  185. data/yard-0.9.44/lib/yard/server/commands/display_object_command.rb +65 -0
  186. data/yard-0.9.44/lib/yard/server/commands/frames_command.rb +16 -0
  187. data/yard-0.9.44/lib/yard/server/commands/library_command.rb +187 -0
  188. data/yard-0.9.44/lib/yard/server/commands/library_index_command.rb +28 -0
  189. data/yard-0.9.44/lib/yard/server/commands/list_command.rb +25 -0
  190. data/yard-0.9.44/lib/yard/server/commands/root_request_command.rb +15 -0
  191. data/yard-0.9.44/lib/yard/server/commands/search_command.rb +79 -0
  192. data/yard-0.9.44/lib/yard/server/commands/static_file_command.rb +23 -0
  193. data/yard-0.9.44/lib/yard/server/commands/static_file_helpers.rb +60 -0
  194. data/yard-0.9.44/lib/yard/server/doc_server_helper.rb +91 -0
  195. data/yard-0.9.44/lib/yard/server/doc_server_serializer.rb +39 -0
  196. data/yard-0.9.44/lib/yard/server/http_utils.rb +512 -0
  197. data/yard-0.9.44/lib/yard/server/library_version.rb +277 -0
  198. data/yard-0.9.44/lib/yard/server/rack_adapter.rb +97 -0
  199. data/yard-0.9.44/lib/yard/server/router.rb +187 -0
  200. data/yard-0.9.44/lib/yard/server/static_caching.rb +77 -0
  201. data/yard-0.9.44/lib/yard/server/templates/default/fulldoc/html/css/custom.css +207 -0
  202. data/yard-0.9.44/lib/yard/server/templates/default/fulldoc/html/images/processing.gif +0 -0
  203. data/yard-0.9.44/lib/yard/server/templates/default/fulldoc/html/js/autocomplete.js +203 -0
  204. data/yard-0.9.44/lib/yard/server/templates/default/layout/html/breadcrumb.erb +21 -0
  205. data/yard-0.9.44/lib/yard/server/templates/default/layout/html/script_setup.erb +7 -0
  206. data/yard-0.9.44/lib/yard/server/templates/default/layout/html/setup.rb +8 -0
  207. data/yard-0.9.44/lib/yard/server/templates/default/method_details/html/permalink.erb +6 -0
  208. data/yard-0.9.44/lib/yard/server/templates/default/method_details/html/setup.rb +5 -0
  209. data/yard-0.9.44/lib/yard/server/templates/doc_server/library_list/html/headers.erb +8 -0
  210. data/yard-0.9.44/lib/yard/server/templates/doc_server/library_list/html/library_list.erb +13 -0
  211. data/yard-0.9.44/lib/yard/server/templates/doc_server/library_list/html/listing.erb +13 -0
  212. data/yard-0.9.44/lib/yard/server/templates/doc_server/library_list/html/setup.rb +6 -0
  213. data/yard-0.9.44/lib/yard/server/templates/doc_server/library_list/html/title.erb +2 -0
  214. data/yard-0.9.44/lib/yard/server/templates/doc_server/processing/html/processing.erb +58 -0
  215. data/yard-0.9.44/lib/yard/server/templates/doc_server/processing/html/setup.rb +4 -0
  216. data/yard-0.9.44/lib/yard/server/templates/doc_server/search/html/search.erb +18 -0
  217. data/yard-0.9.44/lib/yard/server/templates/doc_server/search/html/setup.rb +9 -0
  218. data/yard-0.9.44/lib/yard/server/webrick_adapter.rb +45 -0
  219. data/yard-0.9.44/lib/yard/server.rb +13 -0
  220. data/yard-0.9.44/lib/yard/tags/default_factory.rb +192 -0
  221. data/yard-0.9.44/lib/yard/tags/default_tag.rb +13 -0
  222. data/yard-0.9.44/lib/yard/tags/directives.rb +631 -0
  223. data/yard-0.9.44/lib/yard/tags/library.rb +633 -0
  224. data/yard-0.9.44/lib/yard/tags/option_tag.rb +13 -0
  225. data/yard-0.9.44/lib/yard/tags/overload_tag.rb +72 -0
  226. data/yard-0.9.44/lib/yard/tags/ref_tag.rb +8 -0
  227. data/yard-0.9.44/lib/yard/tags/ref_tag_list.rb +28 -0
  228. data/yard-0.9.44/lib/yard/tags/tag.rb +72 -0
  229. data/yard-0.9.44/lib/yard/tags/tag_format_error.rb +7 -0
  230. data/yard-0.9.44/lib/yard/tags/types_explainer.rb +288 -0
  231. data/yard-0.9.44/lib/yard/templates/engine.rb +185 -0
  232. data/yard-0.9.44/lib/yard/templates/erb_cache.rb +23 -0
  233. data/yard-0.9.44/lib/yard/templates/helpers/base_helper.rb +215 -0
  234. data/yard-0.9.44/lib/yard/templates/helpers/filter_helper.rb +27 -0
  235. data/yard-0.9.44/lib/yard/templates/helpers/html_helper.rb +688 -0
  236. data/yard-0.9.44/lib/yard/templates/helpers/html_syntax_highlight_helper.rb +83 -0
  237. data/yard-0.9.44/lib/yard/templates/helpers/markup/html_entities.rb +2140 -0
  238. data/yard-0.9.44/lib/yard/templates/helpers/markup/hybrid_markdown.rb +2131 -0
  239. data/yard-0.9.44/lib/yard/templates/helpers/markup/rdoc_markdown.rb +23 -0
  240. data/yard-0.9.44/lib/yard/templates/helpers/markup/rdoc_markup.rb +112 -0
  241. data/yard-0.9.44/lib/yard/templates/helpers/markup_helper.rb +175 -0
  242. data/yard-0.9.44/lib/yard/templates/helpers/method_helper.rb +77 -0
  243. data/yard-0.9.44/lib/yard/templates/helpers/module_helper.rb +21 -0
  244. data/yard-0.9.44/lib/yard/templates/helpers/text_helper.rb +112 -0
  245. data/yard-0.9.44/lib/yard/templates/helpers/uml_helper.rb +47 -0
  246. data/yard-0.9.44/lib/yard/templates/section.rb +103 -0
  247. data/yard-0.9.44/lib/yard/templates/template.rb +420 -0
  248. data/yard-0.9.44/lib/yard/templates/template_options.rb +91 -0
  249. data/yard-0.9.44/lib/yard/verifier.rb +151 -0
  250. data/yard-0.9.44/lib/yard/version.rb +6 -0
  251. data/yard-0.9.44/lib/yard.rb +75 -0
  252. data/yard-0.9.44/po/ja.po +31108 -0
  253. data/yard-0.9.44/templates/default/class/dot/setup.rb +7 -0
  254. data/yard-0.9.44/templates/default/class/dot/superklass.erb +3 -0
  255. data/yard-0.9.44/templates/default/class/html/constructor_details.erb +8 -0
  256. data/yard-0.9.44/templates/default/class/html/setup.rb +2 -0
  257. data/yard-0.9.44/templates/default/class/html/subclasses.erb +4 -0
  258. data/yard-0.9.44/templates/default/class/setup.rb +36 -0
  259. data/yard-0.9.44/templates/default/class/text/setup.rb +12 -0
  260. data/yard-0.9.44/templates/default/class/text/subclasses.erb +5 -0
  261. data/yard-0.9.44/templates/default/constant/text/header.erb +11 -0
  262. data/yard-0.9.44/templates/default/constant/text/setup.rb +4 -0
  263. data/yard-0.9.44/templates/default/docstring/html/abstract.erb +4 -0
  264. data/yard-0.9.44/templates/default/docstring/html/deprecated.erb +1 -0
  265. data/yard-0.9.44/templates/default/docstring/html/index.erb +5 -0
  266. data/yard-0.9.44/templates/default/docstring/html/note.erb +6 -0
  267. data/yard-0.9.44/templates/default/docstring/html/private.erb +4 -0
  268. data/yard-0.9.44/templates/default/docstring/html/returns_void.erb +1 -0
  269. data/yard-0.9.44/templates/default/docstring/html/text.erb +1 -0
  270. data/yard-0.9.44/templates/default/docstring/html/todo.erb +6 -0
  271. data/yard-0.9.44/templates/default/docstring/setup.rb +52 -0
  272. data/yard-0.9.44/templates/default/docstring/text/abstract.erb +2 -0
  273. data/yard-0.9.44/templates/default/docstring/text/deprecated.erb +2 -0
  274. data/yard-0.9.44/templates/default/docstring/text/index.erb +2 -0
  275. data/yard-0.9.44/templates/default/docstring/text/note.erb +4 -0
  276. data/yard-0.9.44/templates/default/docstring/text/private.erb +2 -0
  277. data/yard-0.9.44/templates/default/docstring/text/returns_void.erb +1 -0
  278. data/yard-0.9.44/templates/default/docstring/text/text.erb +1 -0
  279. data/yard-0.9.44/templates/default/docstring/text/todo.erb +4 -0
  280. data/yard-0.9.44/templates/default/fulldoc/html/css/common.css +1 -0
  281. data/yard-0.9.44/templates/default/fulldoc/html/css/full_list.css +206 -0
  282. data/yard-0.9.44/templates/default/fulldoc/html/css/style.css +1089 -0
  283. data/yard-0.9.44/templates/default/fulldoc/html/frames.erb +22 -0
  284. data/yard-0.9.44/templates/default/fulldoc/html/full_list.erb +40 -0
  285. data/yard-0.9.44/templates/default/fulldoc/html/full_list_class.erb +2 -0
  286. data/yard-0.9.44/templates/default/fulldoc/html/full_list_file.erb +7 -0
  287. data/yard-0.9.44/templates/default/fulldoc/html/full_list_method.erb +10 -0
  288. data/yard-0.9.44/templates/default/fulldoc/html/js/app.js +801 -0
  289. data/yard-0.9.44/templates/default/fulldoc/html/js/full_list.js +334 -0
  290. data/yard-0.9.44/templates/default/fulldoc/html/js/jquery.js +4 -0
  291. data/yard-0.9.44/templates/default/fulldoc/html/setup.rb +249 -0
  292. data/yard-0.9.44/templates/default/layout/dot/header.erb +6 -0
  293. data/yard-0.9.44/templates/default/layout/dot/setup.rb +15 -0
  294. data/yard-0.9.44/templates/default/layout/html/breadcrumb.erb +11 -0
  295. data/yard-0.9.44/templates/default/layout/html/files.erb +11 -0
  296. data/yard-0.9.44/templates/default/layout/html/footer.erb +5 -0
  297. data/yard-0.9.44/templates/default/layout/html/headers.erb +15 -0
  298. data/yard-0.9.44/templates/default/layout/html/index.erb +2 -0
  299. data/yard-0.9.44/templates/default/layout/html/layout.erb +26 -0
  300. data/yard-0.9.44/templates/default/layout/html/listing.erb +4 -0
  301. data/yard-0.9.44/templates/default/layout/html/objects.erb +32 -0
  302. data/yard-0.9.44/templates/default/layout/html/script_setup.erb +4 -0
  303. data/yard-0.9.44/templates/default/layout/html/search.erb +13 -0
  304. data/yard-0.9.44/templates/default/layout/html/setup.rb +89 -0
  305. data/yard-0.9.44/templates/default/method/html/header.erb +17 -0
  306. data/yard-0.9.44/templates/default/method/setup.rb +4 -0
  307. data/yard-0.9.44/templates/default/method/text/header.erb +1 -0
  308. data/yard-0.9.44/templates/default/method_details/html/header.erb +3 -0
  309. data/yard-0.9.44/templates/default/method_details/html/method_signature.erb +25 -0
  310. data/yard-0.9.44/templates/default/method_details/html/source.erb +10 -0
  311. data/yard-0.9.44/templates/default/method_details/setup.rb +11 -0
  312. data/yard-0.9.44/templates/default/method_details/text/header.erb +10 -0
  313. data/yard-0.9.44/templates/default/method_details/text/method_signature.erb +12 -0
  314. data/yard-0.9.44/templates/default/method_details/text/setup.rb +11 -0
  315. data/yard-0.9.44/templates/default/module/dot/child.erb +1 -0
  316. data/yard-0.9.44/templates/default/module/dot/dependencies.erb +3 -0
  317. data/yard-0.9.44/templates/default/module/dot/header.erb +6 -0
  318. data/yard-0.9.44/templates/default/module/dot/info.erb +14 -0
  319. data/yard-0.9.44/templates/default/module/dot/setup.rb +15 -0
  320. data/yard-0.9.44/templates/default/module/html/attribute_details.erb +10 -0
  321. data/yard-0.9.44/templates/default/module/html/attribute_summary.erb +8 -0
  322. data/yard-0.9.44/templates/default/module/html/box_info.erb +43 -0
  323. data/yard-0.9.44/templates/default/module/html/children.erb +8 -0
  324. data/yard-0.9.44/templates/default/module/html/constant_summary.erb +17 -0
  325. data/yard-0.9.44/templates/default/module/html/defines.erb +3 -0
  326. data/yard-0.9.44/templates/default/module/html/header.erb +5 -0
  327. data/yard-0.9.44/templates/default/module/html/inherited_attributes.erb +14 -0
  328. data/yard-0.9.44/templates/default/module/html/inherited_constants.erb +8 -0
  329. data/yard-0.9.44/templates/default/module/html/inherited_methods.erb +20 -0
  330. data/yard-0.9.44/templates/default/module/html/item_summary.erb +40 -0
  331. data/yard-0.9.44/templates/default/module/html/method_details_list.erb +9 -0
  332. data/yard-0.9.44/templates/default/module/html/method_summary.erb +22 -0
  333. data/yard-0.9.44/templates/default/module/html/methodmissing.erb +12 -0
  334. data/yard-0.9.44/templates/default/module/html/pre_docstring.erb +1 -0
  335. data/yard-0.9.44/templates/default/module/setup.rb +187 -0
  336. data/yard-0.9.44/templates/default/module/text/children.erb +10 -0
  337. data/yard-0.9.44/templates/default/module/text/class_meths_list.erb +8 -0
  338. data/yard-0.9.44/templates/default/module/text/extends.erb +8 -0
  339. data/yard-0.9.44/templates/default/module/text/header.erb +7 -0
  340. data/yard-0.9.44/templates/default/module/text/includes.erb +8 -0
  341. data/yard-0.9.44/templates/default/module/text/instance_meths_list.erb +8 -0
  342. data/yard-0.9.44/templates/default/module/text/setup.rb +13 -0
  343. data/yard-0.9.44/templates/default/onefile/html/files.erb +5 -0
  344. data/yard-0.9.44/templates/default/onefile/html/headers.erb +8 -0
  345. data/yard-0.9.44/templates/default/onefile/html/layout.erb +16 -0
  346. data/yard-0.9.44/templates/default/onefile/html/readme.erb +3 -0
  347. data/yard-0.9.44/templates/default/onefile/html/setup.rb +62 -0
  348. data/yard-0.9.44/templates/default/root/dot/child.erb +3 -0
  349. data/yard-0.9.44/templates/default/root/dot/setup.rb +6 -0
  350. data/yard-0.9.44/templates/default/root/html/setup.rb +2 -0
  351. data/yard-0.9.44/templates/default/tags/html/example.erb +11 -0
  352. data/yard-0.9.44/templates/default/tags/html/index.erb +3 -0
  353. data/yard-0.9.44/templates/default/tags/html/option.erb +24 -0
  354. data/yard-0.9.44/templates/default/tags/html/overload.erb +14 -0
  355. data/yard-0.9.44/templates/default/tags/html/see.erb +8 -0
  356. data/yard-0.9.44/templates/default/tags/html/tag.erb +20 -0
  357. data/yard-0.9.44/templates/default/tags/setup.rb +57 -0
  358. data/yard-0.9.44/templates/default/tags/text/example.erb +12 -0
  359. data/yard-0.9.44/templates/default/tags/text/index.erb +1 -0
  360. data/yard-0.9.44/templates/default/tags/text/option.erb +20 -0
  361. data/yard-0.9.44/templates/default/tags/text/overload.erb +19 -0
  362. data/yard-0.9.44/templates/default/tags/text/see.erb +11 -0
  363. data/yard-0.9.44/templates/default/tags/text/tag.erb +13 -0
  364. data/yard-0.9.44/templates/guide/class/html/setup.rb +2 -0
  365. data/yard-0.9.44/templates/guide/docstring/html/setup.rb +2 -0
  366. data/yard-0.9.44/templates/guide/fulldoc/html/css/style.css +358 -0
  367. data/yard-0.9.44/templates/guide/fulldoc/html/js/app.js +61 -0
  368. data/yard-0.9.44/templates/guide/fulldoc/html/setup.rb +74 -0
  369. data/yard-0.9.44/templates/guide/layout/html/layout.erb +78 -0
  370. data/yard-0.9.44/templates/guide/layout/html/setup.rb +25 -0
  371. data/yard-0.9.44/templates/guide/method/html/header.erb +18 -0
  372. data/yard-0.9.44/templates/guide/method/html/setup.rb +22 -0
  373. data/yard-0.9.44/templates/guide/module/html/header.erb +7 -0
  374. data/yard-0.9.44/templates/guide/module/html/method_list.erb +5 -0
  375. data/yard-0.9.44/templates/guide/module/html/setup.rb +27 -0
  376. data/yard-0.9.44/templates/guide/onefile/html/files.erb +4 -0
  377. data/yard-0.9.44/templates/guide/onefile/html/setup.rb +6 -0
  378. data/yard-0.9.44/templates/guide/onefile/html/toc.erb +3 -0
  379. data/yard-0.9.44/templates/guide/tags/html/setup.rb +9 -0
  380. metadata +419 -0
@@ -0,0 +1,225 @@
1
+ # frozen_string_literal: true
2
+ module YARD
3
+ # Handles all logic for complex lexical and inherited object resolution.
4
+ # Used by {Registry.resolve}, so there is no need to use this class
5
+ # directly.
6
+ #
7
+ # @see Registry.resolve
8
+ # @since 0.9.1
9
+ class RegistryResolver
10
+ include CodeObjects::NamespaceMapper
11
+
12
+ # Creates a new resolver object for a registry.
13
+ #
14
+ # @param registry [Registry] only set this if customizing the registry
15
+ # object
16
+ def initialize(registry = Registry)
17
+ @registry = registry
18
+ @default_sep = nil
19
+
20
+ # Preload all code objects for separator declarations
21
+ YARD::CodeObjects.constants.map {|t| YARD::CodeObjects.const_get(t) }
22
+ end
23
+
24
+ # Performs a lookup on a given path in the registry. Resolution will occur
25
+ # in a similar way to standard Ruby identifier resolution, doing lexical
26
+ # lookup, as well as (optionally) through the inheritance chain. A proxy
27
+ # object can be returned if the lookup fails for future resolution. The
28
+ # proxy will be type hinted with the +type+ used in the original lookup.
29
+ #
30
+ # @option opts namespace [CodeObjects::Base, :root, nil] (nil) the namespace
31
+ # object to start searching from. If root or nil is provided, {Registry.root}
32
+ # is assumed.
33
+ # @option opts inheritance [Boolean] (false) whether to perform lookups through
34
+ # the inheritance chain (includes mixins)
35
+ # @option opts proxy_fallback [Boolean] (false) when true, a proxy is returned
36
+ # if no match is found
37
+ # @option opts type [Symbol] (nil) an optional type hint for the resolver
38
+ # to consider when performing a lookup. If a type is provided and the
39
+ # resolved object's type does not match the hint, the object is discarded.
40
+ # @return [CodeObjects::Base, CodeObjects::Proxy, nil] the first object
41
+ # that matches the path lookup. If proxy_fallback is provided, a proxy
42
+ # object will be returned in the event of no match, otherwise nil will
43
+ # be returned.
44
+ # @example A lookup from root
45
+ # resolver.lookup_by_path("A::B::C")
46
+ # @example A lookup from the A::B namespace
47
+ # resolver.lookup_by_path("C", namespace: P("A::B"))
48
+ # @example A lookup on a method through the inheritance tree
49
+ # resolver.lookup_by_math("A::B#foo", inheritance: true)
50
+ def lookup_by_path(path, opts = {})
51
+ path = path.to_s
52
+ namespace = opts[:namespace]
53
+ inheritance = opts[:inheritance] || false
54
+ proxy_fallback = opts[:proxy_fallback] || false
55
+ type = opts[:type]
56
+
57
+ if namespace.is_a?(CodeObjects::Proxy)
58
+ return proxy_fallback ? CodeObjects::Proxy.new(namespace, path, type) : nil
59
+ end
60
+
61
+ if namespace == :root || !namespace
62
+ namespace = @registry.root
63
+ else
64
+ namespace = namespace.parent until namespace.is_a?(CodeObjects::NamespaceObject)
65
+ end
66
+ orignamespace = namespace
67
+
68
+ if path =~ starts_with_default_separator_match
69
+ path = $'
70
+ namespace = @registry.root
71
+ orignamespace = @registry.root
72
+ end
73
+
74
+ resolved = nil
75
+ lexical_lookup = 0
76
+ while namespace && !resolved
77
+ resolved = lookup_path_direct(namespace, path, type)
78
+ # Prevent a bare name from resolving back to the namespace we started
79
+ # from when searching through a parent namespace. For example,
80
+ # `include Enumerable` inside `A::Enumerable` would walk up to namespace
81
+ # `A` and match `A::Enumerable`, creating a false self-referential mixin.
82
+ # Only skip when we have already moved to a parent (namespace != orignamespace).
83
+ # See https://github.com/lsegal/yard/issues/1116
84
+ resolved = nil if resolved.equal?(orignamespace) && !namespace.equal?(orignamespace)
85
+ resolved ||= lookup_path_inherited(namespace, path, type) if inheritance
86
+ break if resolved
87
+ namespace = namespace.parent
88
+ lexical_lookup += 1
89
+ end
90
+
91
+ # method objects cannot be resolved through lexical lookup by more than 1 ns
92
+ if lexical_lookup > 1 && resolved.is_a?(CodeObjects::MethodObject)
93
+ resolved = nil
94
+ end
95
+
96
+ if proxy_fallback
97
+ resolved ||= CodeObjects::Proxy.new(orignamespace, path, type)
98
+ end
99
+
100
+ resolved
101
+ end
102
+
103
+ private
104
+
105
+ # return [Boolean] if the obj's type matches the provided type.
106
+ def validate(obj, type)
107
+ !type || (obj && obj.type == type) ? obj : nil
108
+ end
109
+
110
+ # Performs a lexical lookup from a namespace for a path and a type hint.
111
+ def lookup_path_direct(namespace, path, type)
112
+ result = namespace.root? && validate(@registry.at(path), type)
113
+ return result if result
114
+
115
+ if path =~ starts_with_separator_match
116
+ return validate(@registry.at(namespace.path + path), type)
117
+ end
118
+
119
+ separators.each do |sep|
120
+ result = validate(@registry.at("#{namespace.path}#{sep}#{path}"), type)
121
+ return result if result
122
+ end
123
+
124
+ nil
125
+ end
126
+
127
+ # Performs a lookup through the inheritance chain on a path with a type hint.
128
+ def lookup_path_inherited(namespace, path, type)
129
+ resolved = nil
130
+ last_obj = namespace
131
+ scopes = []
132
+ last_sep = nil
133
+ pos = 0
134
+
135
+ if path =~ starts_with_separator_match
136
+ last_sep = $1
137
+ path = $'
138
+ end
139
+
140
+ path.scan(split_on_separators_match).each do |part, sep|
141
+ cur_obj = nil
142
+ pos += part.length
143
+ pos += sep.length
144
+ parsed_end = pos == path.length
145
+
146
+ if !last_obj || (!parsed_end && !last_obj.is_a?(CodeObjects::NamespaceObject))
147
+ break # can't continue
148
+ end
149
+
150
+ collect_namespaces(last_obj).each do |ns|
151
+ next if ns.is_a?(CodeObjects::Proxy)
152
+
153
+ found = nil
154
+ search_seps = []
155
+ scopes.each do |scope|
156
+ search_seps += separators_for_type(scope)
157
+ end
158
+
159
+ if search_seps.empty?
160
+ search_seps =
161
+ if ns.type == :root
162
+ [""]
163
+ elsif last_sep.nil?
164
+ separators
165
+ else
166
+ [@default_sep]
167
+ end
168
+ end
169
+
170
+ ([last_sep] | search_seps).compact.each do |search_sep|
171
+ found = @registry.at(ns.path + search_sep.to_s + part)
172
+ break if found
173
+ end
174
+
175
+ break cur_obj = found if found
176
+ end
177
+
178
+ last_sep = sep
179
+ scopes = types_for_separator(sep) || []
180
+ last_obj = cur_obj
181
+ resolved = cur_obj if parsed_end && cur_obj && (type.nil? || type == cur_obj.type)
182
+ end
183
+
184
+ resolved
185
+ end
186
+
187
+ # Collects and returns all inherited namespaces for a given object
188
+ def collect_namespaces(object)
189
+ return [] unless object.respond_to?(:inheritance_tree)
190
+
191
+ nss = object.inheritance_tree(true)
192
+ if object.respond_to?(:superclass)
193
+ nss |= [P('Object')] if object.superclass != P('BasicObject')
194
+ nss |= [P('BasicObject')]
195
+ end
196
+
197
+ nss
198
+ end
199
+
200
+ # @return [Regexp] the regexp match of the default separator
201
+ def starts_with_default_separator_match
202
+ @@starts_with_default_separator_match ||= /\A#{default_separator}/
203
+ end
204
+
205
+ # @return [Regexp] the regexp that matches strings starting with
206
+ # a separator
207
+ def starts_with_separator_match
208
+ @@starts_with_separator_match ||= /\A(#{separators_match})/
209
+ end
210
+
211
+ # @return [Regexp] the regexp that can be used to split a string on all
212
+ # occurrences of separator tokens
213
+ def split_on_separators_match
214
+ @@split_on_separators_match ||= /(.+?)(#{separators_match}|$)/
215
+ end
216
+
217
+ # Additional invalidations to done when NamespaceMapper API methods are
218
+ # called on this class
219
+ YARD::CodeObjects::NamespaceMapper.on_invalidate do
220
+ @@starts_with_default_separator_match = nil
221
+ @@starts_with_separator_match = nil
222
+ @@split_on_separators_match = nil
223
+ end
224
+ end
225
+ end
@@ -0,0 +1,342 @@
1
+ # frozen_string_literal: true
2
+ require 'fileutils'
3
+
4
+ module YARD
5
+ # The data store for the {Registry}.
6
+ #
7
+ # @see Registry
8
+ # @see Serializers::YardocSerializer
9
+ class RegistryStore
10
+ # @deprecated The registry no longer tracks proxy types
11
+ attr_reader :proxy_types
12
+ attr_reader :file, :checksums
13
+
14
+ def initialize
15
+ @file = nil
16
+ @checksums = {}
17
+ @store = {}
18
+ @proxy_types = {}
19
+ @object_types = {:root => [:root]}
20
+ @notfound = {}
21
+ @loaded_objects = 0
22
+ @available_objects = 0
23
+ @locales = {}
24
+ @store[:root] = CodeObjects::RootObject.allocate
25
+ @store[:root].send(:initialize, nil, :root)
26
+ end
27
+
28
+ # Gets a {CodeObjects::Base} from the store
29
+ #
30
+ # @param [String, Symbol] key the path name of the object to look for.
31
+ # If it is empty or :root, returns the {#root} object.
32
+ # @return [CodeObjects::Base, nil] a code object or nil if none is found
33
+ def get(key)
34
+ key = :root if key == ''
35
+ key = key.to_sym
36
+ return @store[key] if @store[key]
37
+ return if @loaded_objects >= @available_objects
38
+
39
+ # check disk
40
+ return if @notfound[key]
41
+ obj = @serializer.deserialize(key)
42
+ if obj
43
+ @loaded_objects += 1
44
+ put(key, obj)
45
+ else
46
+ @notfound[key] = true
47
+ nil
48
+ end
49
+ end
50
+
51
+ # Associates an object with a path
52
+ # @param [String, Symbol] key the path name (:root or '' for root object)
53
+ # @param [CodeObjects::Base] value the object to store
54
+ # @return [CodeObjects::Base] returns +value+
55
+ def put(key, value)
56
+ if key == ''
57
+ @object_types[:root] = [:root]
58
+ @store[:root] = value
59
+ else
60
+ @notfound.delete(key.to_sym)
61
+ (@object_types[value.type] ||= []) << key.to_s
62
+ if @store[key.to_sym]
63
+ @object_types[@store[key.to_sym].type].delete(key.to_s)
64
+ end
65
+ @store[key.to_sym] = value
66
+ end
67
+ end
68
+
69
+ alias [] get
70
+ alias []= put
71
+
72
+ # Deletes an object at a given path
73
+ # @param [#to_sym] key the key to delete
74
+ # @return [void]
75
+ def delete(key)
76
+ if @store[key.to_sym]
77
+ @object_types[@store[key.to_sym].type].delete(key.to_s)
78
+ @store.delete(key.to_sym)
79
+ end
80
+ end
81
+
82
+ # Gets all path names from the store. Loads the entire database
83
+ # if +reload+ is +true+
84
+ #
85
+ # @param [Boolean] reload if false, does not load the entire database
86
+ # before a lookup.
87
+ # @return [Array<Symbol>] the path names of all the code objects
88
+ def keys(reload = false) load_all if reload; @store.keys end
89
+
90
+ # Gets all code objects from the store. Loads the entire database
91
+ # if +reload+ is +true+
92
+ #
93
+ # @param [Boolean] reload if false, does not load the entire database
94
+ # before a lookup.
95
+ # @return [Array<CodeObjects::Base>] all the code objects
96
+ def values(reload = false) load_all if reload; @store.values end
97
+
98
+ # @param [Symbol] type the type to look for
99
+ # @return [Array<String>] a list of object paths with a given
100
+ # {CodeObjects::Base#type}
101
+ # @since 0.8.0
102
+ def paths_for_type(type, reload = false)
103
+ load_all if reload
104
+ @object_types[type] || []
105
+ end
106
+
107
+ # @param [Symbol] type the type to look for
108
+ # @return [Array<CodeObjects::Base>] a list of objects with a given
109
+ # {CodeObjects::Base#type}
110
+ # @since 0.8.0
111
+ def values_for_type(type, reload = false)
112
+ load_all if reload
113
+ paths_for_type(type).map {|t| @store[t.to_sym] }
114
+ end
115
+
116
+ # @return [CodeObjects::RootObject] the root object
117
+ def root; @store[:root] end
118
+
119
+ # @param [String] name the locale name.
120
+ # @return [I18n::Locale] the locale object for +name+.
121
+ # @since 0.8.3
122
+ def locale(name)
123
+ @locales[name] ||= load_locale(name)
124
+ end
125
+
126
+ # @param [String, nil] file the name of the yardoc db to load
127
+ # @return [Boolean] whether the database was loaded
128
+ def load(file = nil)
129
+ initialize
130
+ @file = file
131
+ @serializer = Serializers::YardocSerializer.new(@file)
132
+ load_yardoc
133
+ end
134
+
135
+ # Loads the .yardoc file and loads all cached objects into memory
136
+ # automatically.
137
+ #
138
+ # @param [String, nil] file the name of the yardoc db to load
139
+ # @return [Boolean] whether the database was loaded
140
+ # @see #load_all
141
+ # @since 0.5.1
142
+ def load!(file = nil)
143
+ if load(file)
144
+ load_all
145
+ true
146
+ else
147
+ false
148
+ end
149
+ end
150
+
151
+ # Loads all cached objects into memory
152
+ # @return [void]
153
+ def load_all
154
+ return unless @file
155
+ return if @loaded_objects >= @available_objects
156
+ log.debug "Loading entire database: #{@file} ..."
157
+ objects = []
158
+
159
+ all_disk_objects.sort_by(&:size).each do |path|
160
+ obj = @serializer.deserialize(path, true)
161
+ objects << obj if obj
162
+ end
163
+
164
+ objects.each do |obj|
165
+ put(obj.path, obj)
166
+ end
167
+
168
+ @loaded_objects += objects.size
169
+ log.debug "Loaded database (file='#{@file}' count=#{objects.size} total=#{@available_objects})"
170
+ end
171
+
172
+ # Saves the database to disk
173
+ # @param [Boolean] merge if true, merges the data in memory with the
174
+ # data on disk, otherwise the data on disk is deleted.
175
+ # @param [String, nil] file if supplied, the name of the file to save to
176
+ # @return [Boolean] whether the database was saved
177
+ def save(merge = true, file = nil)
178
+ if file && file != @file
179
+ @file = file
180
+ @serializer = Serializers::YardocSerializer.new(@file)
181
+ end
182
+ destroy unless merge
183
+
184
+ sdb = Registry.single_object_db
185
+ if sdb == true || sdb.nil?
186
+ @serializer.serialize(@store)
187
+ else
188
+ values(false).each do |object|
189
+ @serializer.serialize(object)
190
+ end
191
+ end
192
+ write_proxy_types
193
+ write_object_types
194
+ write_checksums
195
+ write_complete_lock
196
+ true
197
+ end
198
+
199
+ # (see Serializers::YardocSerializer#lock_for_writing)
200
+ # @param file [String] if supplied, the path to the database
201
+ def lock_for_writing(file = nil, &block)
202
+ Serializers::YardocSerializer.new(file || @file).lock_for_writing(&block)
203
+ end
204
+
205
+ # (see Serializers::YardocSerializer#locked_for_writing?)
206
+ # @param file [String] if supplied, the path to the database
207
+ def locked_for_writing?(file = nil)
208
+ Serializers::YardocSerializer.new(file || @file).locked_for_writing?
209
+ end
210
+
211
+ # Deletes the .yardoc database on disk
212
+ #
213
+ # @param [Boolean] force if force is not set to true, the file/directory
214
+ # will only be removed if it ends with .yardoc. This helps with
215
+ # cases where the directory might have been named incorrectly.
216
+ # @return [Boolean] true if the .yardoc database was deleted, false
217
+ # otherwise.
218
+ def destroy(force = false)
219
+ if (!force && file =~ /\.yardoc$/) || force
220
+ if File.file?(@file)
221
+ # Handle silent upgrade of old .yardoc format
222
+ File.unlink(@file)
223
+ elsif File.directory?(@file)
224
+ FileUtils.rm_rf(@file)
225
+ end
226
+ true
227
+ else
228
+ false
229
+ end
230
+ end
231
+
232
+ protected
233
+
234
+ def objects_path
235
+ @serializer.objects_path
236
+ end
237
+
238
+ # @deprecated The registry no longer tracks proxy types
239
+ def proxy_types_path
240
+ @serializer.proxy_types_path
241
+ end
242
+
243
+ def checksums_path
244
+ @serializer.checksums_path
245
+ end
246
+
247
+ def object_types_path
248
+ @serializer.object_types_path
249
+ end
250
+
251
+ def load_yardoc
252
+ return false unless @file
253
+ if File.directory?(@file) # new format
254
+ @loaded_objects = 0
255
+ @available_objects = all_disk_objects.size
256
+ load_proxy_types
257
+ load_checksums
258
+ load_root
259
+ load_object_types
260
+ true
261
+ elsif File.file?(@file) # old format
262
+ load_yardoc_old
263
+ true
264
+ else
265
+ false
266
+ end
267
+ end
268
+
269
+ private
270
+
271
+ def load_yardoc_old
272
+ @store, @proxy_types = *Marshal.load(File.read_binary(@file))
273
+ end
274
+
275
+ # @deprecated The registry no longer tracks proxy types
276
+ def load_proxy_types
277
+ return unless File.file?(proxy_types_path)
278
+ @proxy_types = Marshal.load(File.read_binary(proxy_types_path))
279
+ end
280
+
281
+ def load_object_types
282
+ if File.file?(object_types_path)
283
+ @object_types = Marshal.load(File.read_binary(object_types_path))
284
+ else # migrate db without object_types
285
+ values.each do |object|
286
+ (@object_types[object.type] ||= []) << object.path
287
+ end
288
+ end
289
+ end
290
+
291
+ def load_checksums
292
+ return unless File.file?(checksums_path)
293
+ lines = File.readlines(checksums_path).map do |line|
294
+ line.strip.rpartition(' ').tap { |p| p.delete_at(1) }
295
+ end
296
+ @checksums = Hash[lines]
297
+ end
298
+
299
+ def load_root
300
+ root = @serializer.deserialize('root')
301
+ return if root.nil?
302
+
303
+ @loaded_objects += 1
304
+ if root.is_a?(Hash) # single object db
305
+ log.debug "Loading single object DB from .yardoc"
306
+ @loaded_objects += (root.keys.size - 1)
307
+ @store = root
308
+ else # just the root object
309
+ @store[:root] = root
310
+ end
311
+ end
312
+
313
+ def load_locale(name)
314
+ locale = I18n::Locale.new(name)
315
+ locale.load(Registry.po_dir)
316
+ locale
317
+ end
318
+
319
+ def all_disk_objects
320
+ Dir.glob(File.join(objects_path, '**/*')).select {|f| File.file?(f) }
321
+ end
322
+
323
+ # @deprecated The registry no longer tracks proxy types
324
+ def write_proxy_types
325
+ File.open!(proxy_types_path, 'wb') {|f| f.write(Marshal.dump(@proxy_types)) }
326
+ end
327
+
328
+ def write_object_types
329
+ File.open!(object_types_path, 'wb') {|f| f.write(Marshal.dump(@object_types)) }
330
+ end
331
+
332
+ def write_checksums
333
+ File.open!(checksums_path, 'w') do |f|
334
+ @checksums.each {|k, v| f.puts("#{k} #{v}") }
335
+ end
336
+ end
337
+
338
+ def write_complete_lock
339
+ File.open!(@serializer.complete_lock_path, 'w') {}
340
+ end
341
+ end
342
+ end
@@ -0,0 +1,57 @@
1
+ RubyGems is copyrighted free software by Chad Fowler, Rich Kilmer, Jim
2
+ Weirich and others. You can redistribute it and/or modify it under
3
+ either the terms of the MIT license (see the file MIT.txt), or the
4
+ conditions below:
5
+
6
+ 1. You may make and give away verbatim copies of the source form of the
7
+ software without restriction, provided that you duplicate all of the
8
+ original copyright notices and associated disclaimers.
9
+
10
+ 2. You may modify your copy of the software in any way, provided that
11
+ you do at least ONE of the following:
12
+
13
+ a. place your modifications in the Public Domain or otherwise
14
+ make them Freely Available, such as by posting said
15
+ modifications to Usenet or an equivalent medium, or by allowing
16
+ the author to include your modifications in the software.
17
+
18
+ b. use the modified software only within your corporation or
19
+ organization.
20
+
21
+ c. give non-standard executables non-standard names, with
22
+ instructions on where to get the original software distribution.
23
+
24
+ d. make other distribution arrangements with the author.
25
+
26
+ 3. You may distribute the software in object code or executable
27
+ form, provided that you do at least ONE of the following:
28
+
29
+ a. distribute the executables and library files of the software,
30
+ together with instructions (in the manual page or equivalent)
31
+ on where to get the original distribution.
32
+
33
+ b. accompany the distribution with the machine-readable source of
34
+ the software.
35
+
36
+ c. give non-standard executables non-standard names, with
37
+ instructions on where to get the original software distribution.
38
+
39
+ d. make other distribution arrangements with the author.
40
+
41
+ 4. You may modify and include the part of the software into any other
42
+ software (possibly commercial). But some files in the distribution
43
+ are not written by the author, so that they are not under these terms.
44
+
45
+ For the list of those files and their copying conditions, see the
46
+ file LEGAL.
47
+
48
+ 5. The scripts and library files supplied as input to or produced as
49
+ output from the software do not automatically fall under the
50
+ copyright of the software, but belong to whomever generated them,
51
+ and may be sold commercially, and may be aggregated with this
52
+ software.
53
+
54
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
55
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
56
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
57
+ PURPOSE.
@@ -0,0 +1,20 @@
1
+ Copyright (c) Chad Fowler, Rich Kilmer, Jim Weirich and others.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ 'Software'), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+ module Gem
3
+ class << self
4
+ undef source_index if method_defined?(:source_index)
5
+ # Returns the Gem::SourceIndex of specifications that are in the Gem.path
6
+ def source_index
7
+ @@source_index ||= SourceIndex.from_installed_gems
8
+ end
9
+ end
10
+ end