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.
- checksums.yaml +7 -0
- data/hyper-pro-gem.gemspec +12 -0
- data/yard-0.9.44/CHANGELOG.md +983 -0
- data/yard-0.9.44/LEGAL +94 -0
- data/yard-0.9.44/LICENSE +22 -0
- data/yard-0.9.44/README.md +329 -0
- data/yard-0.9.44/bin/yard +13 -0
- data/yard-0.9.44/bin/yardoc +13 -0
- data/yard-0.9.44/bin/yri +13 -0
- data/yard-0.9.44/docs/CodeObjects.md +115 -0
- data/yard-0.9.44/docs/GettingStarted.md +705 -0
- data/yard-0.9.44/docs/Handlers.md +152 -0
- data/yard-0.9.44/docs/Overview.md +61 -0
- data/yard-0.9.44/docs/Parser.md +166 -0
- data/yard-0.9.44/docs/Tags.md +304 -0
- data/yard-0.9.44/docs/TagsArch.md +123 -0
- data/yard-0.9.44/docs/Templates.md +497 -0
- data/yard-0.9.44/docs/WhatsNew.md +1297 -0
- data/yard-0.9.44/docs/images/code-objects-class-diagram.png +0 -0
- data/yard-0.9.44/docs/images/handlers-class-diagram.png +0 -0
- data/yard-0.9.44/docs/images/overview-class-diagram.png +0 -0
- data/yard-0.9.44/docs/images/parser-class-diagram.png +0 -0
- data/yard-0.9.44/docs/images/tags-class-diagram.png +0 -0
- data/yard-0.9.44/docs/templates/default/fulldoc/html/full_list_tag.erb +9 -0
- data/yard-0.9.44/docs/templates/default/fulldoc/html/setup.rb +6 -0
- data/yard-0.9.44/docs/templates/default/layout/html/setup.rb +9 -0
- data/yard-0.9.44/docs/templates/default/layout/html/tag_list.erb +11 -0
- data/yard-0.9.44/docs/templates/default/yard_tags/html/list.erb +18 -0
- data/yard-0.9.44/docs/templates/default/yard_tags/html/setup.rb +26 -0
- data/yard-0.9.44/docs/templates/plugin.rb +70 -0
- data/yard-0.9.44/lib/rubygems_plugin.rb +9 -0
- data/yard-0.9.44/lib/yard/autoload.rb +328 -0
- data/yard-0.9.44/lib/yard/cli/command.rb +85 -0
- data/yard-0.9.44/lib/yard/cli/command_parser.rb +93 -0
- data/yard-0.9.44/lib/yard/cli/config.rb +198 -0
- data/yard-0.9.44/lib/yard/cli/diff.rb +278 -0
- data/yard-0.9.44/lib/yard/cli/display.rb +69 -0
- data/yard-0.9.44/lib/yard/cli/gems.rb +84 -0
- data/yard-0.9.44/lib/yard/cli/graph.rb +125 -0
- data/yard-0.9.44/lib/yard/cli/help.rb +20 -0
- data/yard-0.9.44/lib/yard/cli/i18n.rb +70 -0
- data/yard-0.9.44/lib/yard/cli/list.rb +23 -0
- data/yard-0.9.44/lib/yard/cli/markup_types.rb +32 -0
- data/yard-0.9.44/lib/yard/cli/server.rb +266 -0
- data/yard-0.9.44/lib/yard/cli/stats.rb +234 -0
- data/yard-0.9.44/lib/yard/cli/yardoc.rb +791 -0
- data/yard-0.9.44/lib/yard/cli/yardopts_command.rb +110 -0
- data/yard-0.9.44/lib/yard/cli/yri.rb +215 -0
- data/yard-0.9.44/lib/yard/code_objects/base.rb +626 -0
- data/yard-0.9.44/lib/yard/code_objects/class_object.rb +146 -0
- data/yard-0.9.44/lib/yard/code_objects/class_variable_object.rb +11 -0
- data/yard-0.9.44/lib/yard/code_objects/constant_object.rb +16 -0
- data/yard-0.9.44/lib/yard/code_objects/extended_method_object.rb +24 -0
- data/yard-0.9.44/lib/yard/code_objects/extra_file_object.rb +135 -0
- data/yard-0.9.44/lib/yard/code_objects/macro_object.rb +171 -0
- data/yard-0.9.44/lib/yard/code_objects/method_object.rb +196 -0
- data/yard-0.9.44/lib/yard/code_objects/module_object.rb +21 -0
- data/yard-0.9.44/lib/yard/code_objects/namespace_mapper.rb +141 -0
- data/yard-0.9.44/lib/yard/code_objects/namespace_object.rb +200 -0
- data/yard-0.9.44/lib/yard/code_objects/proxy.rb +245 -0
- data/yard-0.9.44/lib/yard/code_objects/root_object.rb +19 -0
- data/yard-0.9.44/lib/yard/config.rb +274 -0
- data/yard-0.9.44/lib/yard/core_ext/array.rb +16 -0
- data/yard-0.9.44/lib/yard/core_ext/file.rb +69 -0
- data/yard-0.9.44/lib/yard/core_ext/hash.rb +16 -0
- data/yard-0.9.44/lib/yard/core_ext/insertion.rb +63 -0
- data/yard-0.9.44/lib/yard/core_ext/module.rb +11 -0
- data/yard-0.9.44/lib/yard/core_ext/string.rb +68 -0
- data/yard-0.9.44/lib/yard/core_ext/symbol_hash.rb +75 -0
- data/yard-0.9.44/lib/yard/docstring.rb +386 -0
- data/yard-0.9.44/lib/yard/docstring_parser.rb +344 -0
- data/yard-0.9.44/lib/yard/gem_index.rb +29 -0
- data/yard-0.9.44/lib/yard/globals.rb +22 -0
- data/yard-0.9.44/lib/yard/handlers/base.rb +617 -0
- data/yard-0.9.44/lib/yard/handlers/c/alias_handler.rb +16 -0
- data/yard-0.9.44/lib/yard/handlers/c/attribute_handler.rb +13 -0
- data/yard-0.9.44/lib/yard/handlers/c/base.rb +164 -0
- data/yard-0.9.44/lib/yard/handlers/c/class_handler.rb +27 -0
- data/yard-0.9.44/lib/yard/handlers/c/constant_handler.rb +13 -0
- data/yard-0.9.44/lib/yard/handlers/c/handler_methods.rb +212 -0
- data/yard-0.9.44/lib/yard/handlers/c/init_handler.rb +20 -0
- data/yard-0.9.44/lib/yard/handlers/c/method_handler.rb +45 -0
- data/yard-0.9.44/lib/yard/handlers/c/mixin_handler.rb +21 -0
- data/yard-0.9.44/lib/yard/handlers/c/module_handler.rb +17 -0
- data/yard-0.9.44/lib/yard/handlers/c/override_comment_handler.rb +31 -0
- data/yard-0.9.44/lib/yard/handlers/c/path_handler.rb +11 -0
- data/yard-0.9.44/lib/yard/handlers/c/struct_handler.rb +13 -0
- data/yard-0.9.44/lib/yard/handlers/c/symbol_handler.rb +8 -0
- data/yard-0.9.44/lib/yard/handlers/common/method_handler.rb +19 -0
- data/yard-0.9.44/lib/yard/handlers/processor.rb +200 -0
- data/yard-0.9.44/lib/yard/handlers/rbs/attribute_handler.rb +79 -0
- data/yard-0.9.44/lib/yard/handlers/rbs/base.rb +38 -0
- data/yard-0.9.44/lib/yard/handlers/rbs/constant_handler.rb +18 -0
- data/yard-0.9.44/lib/yard/handlers/rbs/method_handler.rb +327 -0
- data/yard-0.9.44/lib/yard/handlers/rbs/mixin_handler.rb +20 -0
- data/yard-0.9.44/lib/yard/handlers/rbs/namespace_handler.rb +26 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/alias_handler.rb +45 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/attribute_handler.rb +90 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/base.rb +165 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/class_condition_handler.rb +92 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/class_handler.rb +119 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/class_variable_handler.rb +17 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/comment_handler.rb +10 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/constant_handler.rb +73 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/decorator_handler_methods.rb +123 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/dsl_handler.rb +15 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/dsl_handler_methods.rb +96 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/exception_handler.rb +27 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/extend_handler.rb +22 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/legacy/alias_handler.rb +37 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/legacy/attribute_handler.rb +65 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/legacy/base.rb +245 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/legacy/class_condition_handler.rb +83 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/legacy/class_handler.rb +113 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/legacy/class_variable_handler.rb +15 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/legacy/comment_handler.rb +10 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/legacy/constant_handler.rb +29 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/legacy/dsl_handler.rb +17 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/legacy/exception_handler.rb +13 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/legacy/extend_handler.rb +21 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/legacy/method_handler.rb +90 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/legacy/mixin_handler.rb +39 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/legacy/module_function_handler.rb +19 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/legacy/module_handler.rb +12 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/legacy/private_class_method_handler.rb +22 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/legacy/private_constant_handler.rb +22 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/legacy/visibility_handler.rb +18 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/legacy/yield_handler.rb +29 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/method_condition_handler.rb +9 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/method_handler.rb +104 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/mixin_handler.rb +61 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/module_function_handler.rb +39 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/module_handler.rb +12 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/private_class_method_handler.rb +14 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/private_constant_handler.rb +43 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/public_class_method_handler.rb +14 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/struct_handler_methods.rb +143 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/visibility_handler.rb +35 -0
- data/yard-0.9.44/lib/yard/handlers/ruby/yield_handler.rb +31 -0
- data/yard-0.9.44/lib/yard/i18n/locale.rb +67 -0
- data/yard-0.9.44/lib/yard/i18n/message.rb +57 -0
- data/yard-0.9.44/lib/yard/i18n/messages.rb +56 -0
- data/yard-0.9.44/lib/yard/i18n/po_parser.rb +61 -0
- data/yard-0.9.44/lib/yard/i18n/pot_generator.rb +290 -0
- data/yard-0.9.44/lib/yard/i18n/text.rb +173 -0
- data/yard-0.9.44/lib/yard/logging.rb +260 -0
- data/yard-0.9.44/lib/yard/open_struct.rb +67 -0
- data/yard-0.9.44/lib/yard/options.rb +217 -0
- data/yard-0.9.44/lib/yard/parser/base.rb +57 -0
- data/yard-0.9.44/lib/yard/parser/c/c_parser.rb +235 -0
- data/yard-0.9.44/lib/yard/parser/c/comment_parser.rb +134 -0
- data/yard-0.9.44/lib/yard/parser/c/statement.rb +66 -0
- data/yard-0.9.44/lib/yard/parser/rbs/rbs_parser.rb +325 -0
- data/yard-0.9.44/lib/yard/parser/rbs/statement.rb +75 -0
- data/yard-0.9.44/lib/yard/parser/ruby/ast_node.rb +559 -0
- data/yard-0.9.44/lib/yard/parser/ruby/legacy/irb/slex.rb +294 -0
- data/yard-0.9.44/lib/yard/parser/ruby/legacy/ruby_lex.rb +1360 -0
- data/yard-0.9.44/lib/yard/parser/ruby/legacy/ruby_parser.rb +32 -0
- data/yard-0.9.44/lib/yard/parser/ruby/legacy/statement.rb +68 -0
- data/yard-0.9.44/lib/yard/parser/ruby/legacy/statement_list.rb +394 -0
- data/yard-0.9.44/lib/yard/parser/ruby/legacy/token_list.rb +74 -0
- data/yard-0.9.44/lib/yard/parser/ruby/ruby_parser.rb +792 -0
- data/yard-0.9.44/lib/yard/parser/ruby/token_resolver.rb +158 -0
- data/yard-0.9.44/lib/yard/parser/source_parser.rb +526 -0
- data/yard-0.9.44/lib/yard/rake/yardoc_task.rb +81 -0
- data/yard-0.9.44/lib/yard/registry.rb +439 -0
- data/yard-0.9.44/lib/yard/registry_resolver.rb +225 -0
- data/yard-0.9.44/lib/yard/registry_store.rb +342 -0
- data/yard-0.9.44/lib/yard/rubygems/backports/LICENSE.txt +57 -0
- data/yard-0.9.44/lib/yard/rubygems/backports/MIT.txt +20 -0
- data/yard-0.9.44/lib/yard/rubygems/backports/gem.rb +10 -0
- data/yard-0.9.44/lib/yard/rubygems/backports/source_index.rb +365 -0
- data/yard-0.9.44/lib/yard/rubygems/backports.rb +10 -0
- data/yard-0.9.44/lib/yard/rubygems/doc_manager.rb +90 -0
- data/yard-0.9.44/lib/yard/rubygems/hook.rb +197 -0
- data/yard-0.9.44/lib/yard/rubygems/specification.rb +50 -0
- data/yard-0.9.44/lib/yard/serializers/base.rb +83 -0
- data/yard-0.9.44/lib/yard/serializers/file_system_serializer.rb +123 -0
- data/yard-0.9.44/lib/yard/serializers/process_serializer.rb +24 -0
- data/yard-0.9.44/lib/yard/serializers/stdout_serializer.rb +34 -0
- data/yard-0.9.44/lib/yard/serializers/yardoc_serializer.rb +152 -0
- data/yard-0.9.44/lib/yard/server/adapter.rb +100 -0
- data/yard-0.9.44/lib/yard/server/commands/base.rb +203 -0
- data/yard-0.9.44/lib/yard/server/commands/display_file_command.rb +29 -0
- data/yard-0.9.44/lib/yard/server/commands/display_object_command.rb +65 -0
- data/yard-0.9.44/lib/yard/server/commands/frames_command.rb +16 -0
- data/yard-0.9.44/lib/yard/server/commands/library_command.rb +187 -0
- data/yard-0.9.44/lib/yard/server/commands/library_index_command.rb +28 -0
- data/yard-0.9.44/lib/yard/server/commands/list_command.rb +25 -0
- data/yard-0.9.44/lib/yard/server/commands/root_request_command.rb +15 -0
- data/yard-0.9.44/lib/yard/server/commands/search_command.rb +79 -0
- data/yard-0.9.44/lib/yard/server/commands/static_file_command.rb +23 -0
- data/yard-0.9.44/lib/yard/server/commands/static_file_helpers.rb +60 -0
- data/yard-0.9.44/lib/yard/server/doc_server_helper.rb +91 -0
- data/yard-0.9.44/lib/yard/server/doc_server_serializer.rb +39 -0
- data/yard-0.9.44/lib/yard/server/http_utils.rb +512 -0
- data/yard-0.9.44/lib/yard/server/library_version.rb +277 -0
- data/yard-0.9.44/lib/yard/server/rack_adapter.rb +97 -0
- data/yard-0.9.44/lib/yard/server/router.rb +187 -0
- data/yard-0.9.44/lib/yard/server/static_caching.rb +77 -0
- data/yard-0.9.44/lib/yard/server/templates/default/fulldoc/html/css/custom.css +207 -0
- data/yard-0.9.44/lib/yard/server/templates/default/fulldoc/html/images/processing.gif +0 -0
- data/yard-0.9.44/lib/yard/server/templates/default/fulldoc/html/js/autocomplete.js +203 -0
- data/yard-0.9.44/lib/yard/server/templates/default/layout/html/breadcrumb.erb +21 -0
- data/yard-0.9.44/lib/yard/server/templates/default/layout/html/script_setup.erb +7 -0
- data/yard-0.9.44/lib/yard/server/templates/default/layout/html/setup.rb +8 -0
- data/yard-0.9.44/lib/yard/server/templates/default/method_details/html/permalink.erb +6 -0
- data/yard-0.9.44/lib/yard/server/templates/default/method_details/html/setup.rb +5 -0
- data/yard-0.9.44/lib/yard/server/templates/doc_server/library_list/html/headers.erb +8 -0
- data/yard-0.9.44/lib/yard/server/templates/doc_server/library_list/html/library_list.erb +13 -0
- data/yard-0.9.44/lib/yard/server/templates/doc_server/library_list/html/listing.erb +13 -0
- data/yard-0.9.44/lib/yard/server/templates/doc_server/library_list/html/setup.rb +6 -0
- data/yard-0.9.44/lib/yard/server/templates/doc_server/library_list/html/title.erb +2 -0
- data/yard-0.9.44/lib/yard/server/templates/doc_server/processing/html/processing.erb +58 -0
- data/yard-0.9.44/lib/yard/server/templates/doc_server/processing/html/setup.rb +4 -0
- data/yard-0.9.44/lib/yard/server/templates/doc_server/search/html/search.erb +18 -0
- data/yard-0.9.44/lib/yard/server/templates/doc_server/search/html/setup.rb +9 -0
- data/yard-0.9.44/lib/yard/server/webrick_adapter.rb +45 -0
- data/yard-0.9.44/lib/yard/server.rb +13 -0
- data/yard-0.9.44/lib/yard/tags/default_factory.rb +192 -0
- data/yard-0.9.44/lib/yard/tags/default_tag.rb +13 -0
- data/yard-0.9.44/lib/yard/tags/directives.rb +631 -0
- data/yard-0.9.44/lib/yard/tags/library.rb +633 -0
- data/yard-0.9.44/lib/yard/tags/option_tag.rb +13 -0
- data/yard-0.9.44/lib/yard/tags/overload_tag.rb +72 -0
- data/yard-0.9.44/lib/yard/tags/ref_tag.rb +8 -0
- data/yard-0.9.44/lib/yard/tags/ref_tag_list.rb +28 -0
- data/yard-0.9.44/lib/yard/tags/tag.rb +72 -0
- data/yard-0.9.44/lib/yard/tags/tag_format_error.rb +7 -0
- data/yard-0.9.44/lib/yard/tags/types_explainer.rb +288 -0
- data/yard-0.9.44/lib/yard/templates/engine.rb +185 -0
- data/yard-0.9.44/lib/yard/templates/erb_cache.rb +23 -0
- data/yard-0.9.44/lib/yard/templates/helpers/base_helper.rb +215 -0
- data/yard-0.9.44/lib/yard/templates/helpers/filter_helper.rb +27 -0
- data/yard-0.9.44/lib/yard/templates/helpers/html_helper.rb +688 -0
- data/yard-0.9.44/lib/yard/templates/helpers/html_syntax_highlight_helper.rb +83 -0
- data/yard-0.9.44/lib/yard/templates/helpers/markup/html_entities.rb +2140 -0
- data/yard-0.9.44/lib/yard/templates/helpers/markup/hybrid_markdown.rb +2131 -0
- data/yard-0.9.44/lib/yard/templates/helpers/markup/rdoc_markdown.rb +23 -0
- data/yard-0.9.44/lib/yard/templates/helpers/markup/rdoc_markup.rb +112 -0
- data/yard-0.9.44/lib/yard/templates/helpers/markup_helper.rb +175 -0
- data/yard-0.9.44/lib/yard/templates/helpers/method_helper.rb +77 -0
- data/yard-0.9.44/lib/yard/templates/helpers/module_helper.rb +21 -0
- data/yard-0.9.44/lib/yard/templates/helpers/text_helper.rb +112 -0
- data/yard-0.9.44/lib/yard/templates/helpers/uml_helper.rb +47 -0
- data/yard-0.9.44/lib/yard/templates/section.rb +103 -0
- data/yard-0.9.44/lib/yard/templates/template.rb +420 -0
- data/yard-0.9.44/lib/yard/templates/template_options.rb +91 -0
- data/yard-0.9.44/lib/yard/verifier.rb +151 -0
- data/yard-0.9.44/lib/yard/version.rb +6 -0
- data/yard-0.9.44/lib/yard.rb +75 -0
- data/yard-0.9.44/po/ja.po +31108 -0
- data/yard-0.9.44/templates/default/class/dot/setup.rb +7 -0
- data/yard-0.9.44/templates/default/class/dot/superklass.erb +3 -0
- data/yard-0.9.44/templates/default/class/html/constructor_details.erb +8 -0
- data/yard-0.9.44/templates/default/class/html/setup.rb +2 -0
- data/yard-0.9.44/templates/default/class/html/subclasses.erb +4 -0
- data/yard-0.9.44/templates/default/class/setup.rb +36 -0
- data/yard-0.9.44/templates/default/class/text/setup.rb +12 -0
- data/yard-0.9.44/templates/default/class/text/subclasses.erb +5 -0
- data/yard-0.9.44/templates/default/constant/text/header.erb +11 -0
- data/yard-0.9.44/templates/default/constant/text/setup.rb +4 -0
- data/yard-0.9.44/templates/default/docstring/html/abstract.erb +4 -0
- data/yard-0.9.44/templates/default/docstring/html/deprecated.erb +1 -0
- data/yard-0.9.44/templates/default/docstring/html/index.erb +5 -0
- data/yard-0.9.44/templates/default/docstring/html/note.erb +6 -0
- data/yard-0.9.44/templates/default/docstring/html/private.erb +4 -0
- data/yard-0.9.44/templates/default/docstring/html/returns_void.erb +1 -0
- data/yard-0.9.44/templates/default/docstring/html/text.erb +1 -0
- data/yard-0.9.44/templates/default/docstring/html/todo.erb +6 -0
- data/yard-0.9.44/templates/default/docstring/setup.rb +52 -0
- data/yard-0.9.44/templates/default/docstring/text/abstract.erb +2 -0
- data/yard-0.9.44/templates/default/docstring/text/deprecated.erb +2 -0
- data/yard-0.9.44/templates/default/docstring/text/index.erb +2 -0
- data/yard-0.9.44/templates/default/docstring/text/note.erb +4 -0
- data/yard-0.9.44/templates/default/docstring/text/private.erb +2 -0
- data/yard-0.9.44/templates/default/docstring/text/returns_void.erb +1 -0
- data/yard-0.9.44/templates/default/docstring/text/text.erb +1 -0
- data/yard-0.9.44/templates/default/docstring/text/todo.erb +4 -0
- data/yard-0.9.44/templates/default/fulldoc/html/css/common.css +1 -0
- data/yard-0.9.44/templates/default/fulldoc/html/css/full_list.css +206 -0
- data/yard-0.9.44/templates/default/fulldoc/html/css/style.css +1089 -0
- data/yard-0.9.44/templates/default/fulldoc/html/frames.erb +22 -0
- data/yard-0.9.44/templates/default/fulldoc/html/full_list.erb +40 -0
- data/yard-0.9.44/templates/default/fulldoc/html/full_list_class.erb +2 -0
- data/yard-0.9.44/templates/default/fulldoc/html/full_list_file.erb +7 -0
- data/yard-0.9.44/templates/default/fulldoc/html/full_list_method.erb +10 -0
- data/yard-0.9.44/templates/default/fulldoc/html/js/app.js +801 -0
- data/yard-0.9.44/templates/default/fulldoc/html/js/full_list.js +334 -0
- data/yard-0.9.44/templates/default/fulldoc/html/js/jquery.js +4 -0
- data/yard-0.9.44/templates/default/fulldoc/html/setup.rb +249 -0
- data/yard-0.9.44/templates/default/layout/dot/header.erb +6 -0
- data/yard-0.9.44/templates/default/layout/dot/setup.rb +15 -0
- data/yard-0.9.44/templates/default/layout/html/breadcrumb.erb +11 -0
- data/yard-0.9.44/templates/default/layout/html/files.erb +11 -0
- data/yard-0.9.44/templates/default/layout/html/footer.erb +5 -0
- data/yard-0.9.44/templates/default/layout/html/headers.erb +15 -0
- data/yard-0.9.44/templates/default/layout/html/index.erb +2 -0
- data/yard-0.9.44/templates/default/layout/html/layout.erb +26 -0
- data/yard-0.9.44/templates/default/layout/html/listing.erb +4 -0
- data/yard-0.9.44/templates/default/layout/html/objects.erb +32 -0
- data/yard-0.9.44/templates/default/layout/html/script_setup.erb +4 -0
- data/yard-0.9.44/templates/default/layout/html/search.erb +13 -0
- data/yard-0.9.44/templates/default/layout/html/setup.rb +89 -0
- data/yard-0.9.44/templates/default/method/html/header.erb +17 -0
- data/yard-0.9.44/templates/default/method/setup.rb +4 -0
- data/yard-0.9.44/templates/default/method/text/header.erb +1 -0
- data/yard-0.9.44/templates/default/method_details/html/header.erb +3 -0
- data/yard-0.9.44/templates/default/method_details/html/method_signature.erb +25 -0
- data/yard-0.9.44/templates/default/method_details/html/source.erb +10 -0
- data/yard-0.9.44/templates/default/method_details/setup.rb +11 -0
- data/yard-0.9.44/templates/default/method_details/text/header.erb +10 -0
- data/yard-0.9.44/templates/default/method_details/text/method_signature.erb +12 -0
- data/yard-0.9.44/templates/default/method_details/text/setup.rb +11 -0
- data/yard-0.9.44/templates/default/module/dot/child.erb +1 -0
- data/yard-0.9.44/templates/default/module/dot/dependencies.erb +3 -0
- data/yard-0.9.44/templates/default/module/dot/header.erb +6 -0
- data/yard-0.9.44/templates/default/module/dot/info.erb +14 -0
- data/yard-0.9.44/templates/default/module/dot/setup.rb +15 -0
- data/yard-0.9.44/templates/default/module/html/attribute_details.erb +10 -0
- data/yard-0.9.44/templates/default/module/html/attribute_summary.erb +8 -0
- data/yard-0.9.44/templates/default/module/html/box_info.erb +43 -0
- data/yard-0.9.44/templates/default/module/html/children.erb +8 -0
- data/yard-0.9.44/templates/default/module/html/constant_summary.erb +17 -0
- data/yard-0.9.44/templates/default/module/html/defines.erb +3 -0
- data/yard-0.9.44/templates/default/module/html/header.erb +5 -0
- data/yard-0.9.44/templates/default/module/html/inherited_attributes.erb +14 -0
- data/yard-0.9.44/templates/default/module/html/inherited_constants.erb +8 -0
- data/yard-0.9.44/templates/default/module/html/inherited_methods.erb +20 -0
- data/yard-0.9.44/templates/default/module/html/item_summary.erb +40 -0
- data/yard-0.9.44/templates/default/module/html/method_details_list.erb +9 -0
- data/yard-0.9.44/templates/default/module/html/method_summary.erb +22 -0
- data/yard-0.9.44/templates/default/module/html/methodmissing.erb +12 -0
- data/yard-0.9.44/templates/default/module/html/pre_docstring.erb +1 -0
- data/yard-0.9.44/templates/default/module/setup.rb +187 -0
- data/yard-0.9.44/templates/default/module/text/children.erb +10 -0
- data/yard-0.9.44/templates/default/module/text/class_meths_list.erb +8 -0
- data/yard-0.9.44/templates/default/module/text/extends.erb +8 -0
- data/yard-0.9.44/templates/default/module/text/header.erb +7 -0
- data/yard-0.9.44/templates/default/module/text/includes.erb +8 -0
- data/yard-0.9.44/templates/default/module/text/instance_meths_list.erb +8 -0
- data/yard-0.9.44/templates/default/module/text/setup.rb +13 -0
- data/yard-0.9.44/templates/default/onefile/html/files.erb +5 -0
- data/yard-0.9.44/templates/default/onefile/html/headers.erb +8 -0
- data/yard-0.9.44/templates/default/onefile/html/layout.erb +16 -0
- data/yard-0.9.44/templates/default/onefile/html/readme.erb +3 -0
- data/yard-0.9.44/templates/default/onefile/html/setup.rb +62 -0
- data/yard-0.9.44/templates/default/root/dot/child.erb +3 -0
- data/yard-0.9.44/templates/default/root/dot/setup.rb +6 -0
- data/yard-0.9.44/templates/default/root/html/setup.rb +2 -0
- data/yard-0.9.44/templates/default/tags/html/example.erb +11 -0
- data/yard-0.9.44/templates/default/tags/html/index.erb +3 -0
- data/yard-0.9.44/templates/default/tags/html/option.erb +24 -0
- data/yard-0.9.44/templates/default/tags/html/overload.erb +14 -0
- data/yard-0.9.44/templates/default/tags/html/see.erb +8 -0
- data/yard-0.9.44/templates/default/tags/html/tag.erb +20 -0
- data/yard-0.9.44/templates/default/tags/setup.rb +57 -0
- data/yard-0.9.44/templates/default/tags/text/example.erb +12 -0
- data/yard-0.9.44/templates/default/tags/text/index.erb +1 -0
- data/yard-0.9.44/templates/default/tags/text/option.erb +20 -0
- data/yard-0.9.44/templates/default/tags/text/overload.erb +19 -0
- data/yard-0.9.44/templates/default/tags/text/see.erb +11 -0
- data/yard-0.9.44/templates/default/tags/text/tag.erb +13 -0
- data/yard-0.9.44/templates/guide/class/html/setup.rb +2 -0
- data/yard-0.9.44/templates/guide/docstring/html/setup.rb +2 -0
- data/yard-0.9.44/templates/guide/fulldoc/html/css/style.css +358 -0
- data/yard-0.9.44/templates/guide/fulldoc/html/js/app.js +61 -0
- data/yard-0.9.44/templates/guide/fulldoc/html/setup.rb +74 -0
- data/yard-0.9.44/templates/guide/layout/html/layout.erb +78 -0
- data/yard-0.9.44/templates/guide/layout/html/setup.rb +25 -0
- data/yard-0.9.44/templates/guide/method/html/header.erb +18 -0
- data/yard-0.9.44/templates/guide/method/html/setup.rb +22 -0
- data/yard-0.9.44/templates/guide/module/html/header.erb +7 -0
- data/yard-0.9.44/templates/guide/module/html/method_list.erb +5 -0
- data/yard-0.9.44/templates/guide/module/html/setup.rb +27 -0
- data/yard-0.9.44/templates/guide/onefile/html/files.erb +4 -0
- data/yard-0.9.44/templates/guide/onefile/html/setup.rb +6 -0
- data/yard-0.9.44/templates/guide/onefile/html/toc.erb +3 -0
- data/yard-0.9.44/templates/guide/tags/html/setup.rb +9 -0
- metadata +419 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# Handles the 'include' statement to mixin a module in the instance scope
|
|
3
|
+
class YARD::Handlers::Ruby::MixinHandler < YARD::Handlers::Ruby::Base
|
|
4
|
+
handles method_call(:include)
|
|
5
|
+
handles method_call(:prepend)
|
|
6
|
+
namespace_only
|
|
7
|
+
|
|
8
|
+
process do
|
|
9
|
+
errors = []
|
|
10
|
+
statement.parameters(false).reverse.each do |mixin|
|
|
11
|
+
begin
|
|
12
|
+
process_mixin(mixin)
|
|
13
|
+
rescue YARD::Parser::UndocumentableError => err
|
|
14
|
+
errors << err.message
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
unless errors.empty?
|
|
18
|
+
msg = errors.size == 1 ? ": #{errors[0]}" : "s: #{errors.join(", ")}"
|
|
19
|
+
raise YARD::Parser::UndocumentableError, "mixin#{msg} for class #{namespace.path}"
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
protected
|
|
24
|
+
|
|
25
|
+
def process_mixin(mixin)
|
|
26
|
+
raise YARD::Parser::UndocumentableError unless mixin.ref?
|
|
27
|
+
raise YARD::Parser::UndocumentableError if mixin.first.type == :ident
|
|
28
|
+
|
|
29
|
+
if mixin.type == :var_ref && mixin[0] == s(:kw, "self")
|
|
30
|
+
obj = namespace
|
|
31
|
+
else
|
|
32
|
+
case obj = Proxy.new(namespace, mixin.source)
|
|
33
|
+
when ConstantObject # If a constant is included, use its value as the real object
|
|
34
|
+
obj = Proxy.new(namespace, obj.value, :module)
|
|
35
|
+
else
|
|
36
|
+
obj = Proxy.new(namespace, mixin.source, :module)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
rec = recipient(mixin)
|
|
41
|
+
return if rec.nil?
|
|
42
|
+
|
|
43
|
+
ensure_loaded!(rec)
|
|
44
|
+
return if rec.mixins(scope).include?(obj)
|
|
45
|
+
|
|
46
|
+
shift = statement.method_name(true) == :include ? :unshift : :push
|
|
47
|
+
rec.mixins(scope).send(shift, obj)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def recipient(mixin)
|
|
51
|
+
if statement[0].type == :const_path_ref || statement[0].type == :top_const_ref
|
|
52
|
+
Proxy.new(namespace, statement[0].source)
|
|
53
|
+
elsif statement[0].type == :var_ref && statement[0][0] != s(:kw, "self")
|
|
54
|
+
statement[0][0].type == :const ?
|
|
55
|
+
Proxy.new(namespace, statement.namespace.source) :
|
|
56
|
+
nil
|
|
57
|
+
else
|
|
58
|
+
namespace
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# Handles module_function calls to turn methods into public class methods.
|
|
3
|
+
# Also creates a private instance copy of the method.
|
|
4
|
+
class YARD::Handlers::Ruby::ModuleFunctionHandler < YARD::Handlers::Ruby::Base
|
|
5
|
+
include YARD::Handlers::Ruby::DecoratorHandlerMethods
|
|
6
|
+
|
|
7
|
+
handles method_call(:module_function)
|
|
8
|
+
namespace_only
|
|
9
|
+
|
|
10
|
+
process do
|
|
11
|
+
return if statement.jump(:ident) == statement
|
|
12
|
+
case statement.type
|
|
13
|
+
when :var_ref, :vcall
|
|
14
|
+
self.scope = :module
|
|
15
|
+
when :fcall, :command
|
|
16
|
+
statement[1].traverse do |node|
|
|
17
|
+
case node.type
|
|
18
|
+
when :def
|
|
19
|
+
process_decorator do |instance_method|
|
|
20
|
+
make_module_function(instance_method, namespace)
|
|
21
|
+
end
|
|
22
|
+
break
|
|
23
|
+
when :symbol; name = node.first.source
|
|
24
|
+
when :string_content; name = node.source
|
|
25
|
+
else next
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
instance_method = MethodObject.new(namespace, name)
|
|
29
|
+
make_module_function(instance_method, namespace)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def make_module_function(instance_method, namespace)
|
|
35
|
+
class_method = MethodObject.new(namespace, instance_method.name, :module)
|
|
36
|
+
instance_method.copy_to(class_method)
|
|
37
|
+
class_method.visibility = :public
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# Handles the declaration of a module
|
|
3
|
+
class YARD::Handlers::Ruby::ModuleHandler < YARD::Handlers::Ruby::Base
|
|
4
|
+
handles :module
|
|
5
|
+
namespace_only
|
|
6
|
+
|
|
7
|
+
process do
|
|
8
|
+
modname = statement[0].source
|
|
9
|
+
mod = register ModuleObject.new(namespace, modname)
|
|
10
|
+
parse_block(statement[1], :namespace => mod)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# Sets visibility of a class method to private.
|
|
3
|
+
class YARD::Handlers::Ruby::PrivateClassMethodHandler < YARD::Handlers::Ruby::Base
|
|
4
|
+
include YARD::Handlers::Ruby::DecoratorHandlerMethods
|
|
5
|
+
|
|
6
|
+
handles method_call(:private_class_method)
|
|
7
|
+
namespace_only
|
|
8
|
+
|
|
9
|
+
process do
|
|
10
|
+
process_decorator :scope => :class do |method|
|
|
11
|
+
method.visibility = :private if method.respond_to? :visibility=
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
module YARD
|
|
3
|
+
module Handlers
|
|
4
|
+
module Ruby
|
|
5
|
+
# Sets visibility of a constant (class, module, const)
|
|
6
|
+
class PrivateConstantHandler < YARD::Handlers::Ruby::Base
|
|
7
|
+
handles method_call(:private_constant)
|
|
8
|
+
namespace_only
|
|
9
|
+
|
|
10
|
+
process do
|
|
11
|
+
errors = []
|
|
12
|
+
statement.parameters.each do |param|
|
|
13
|
+
next unless AstNode === param
|
|
14
|
+
begin
|
|
15
|
+
privatize_constant(param)
|
|
16
|
+
rescue UndocumentableError => err
|
|
17
|
+
errors << err.message
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
unless errors.empty?
|
|
21
|
+
msg = errors.size == 1 ? ": #{errors[0]}" : "s: #{errors.join(", ")}"
|
|
22
|
+
raise UndocumentableError, "private constant#{msg} for #{namespace.path}"
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
private
|
|
27
|
+
|
|
28
|
+
def privatize_constant(node)
|
|
29
|
+
if node.literal? || (node.type == :var_ref && node[0].type == :const)
|
|
30
|
+
node = node.jump(:tstring_content, :const)
|
|
31
|
+
const = Proxy.new(namespace, node[0])
|
|
32
|
+
ensure_loaded!(const)
|
|
33
|
+
const.visibility = :private
|
|
34
|
+
else
|
|
35
|
+
raise UndocumentableError, "invalid argument to private_constant: #{node.source}"
|
|
36
|
+
end
|
|
37
|
+
rescue NamespaceMissingError
|
|
38
|
+
raise UndocumentableError, "private visibility set on unrecognized constant: #{node[0]}"
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# Sets visibility of a class method to public.
|
|
3
|
+
class YARD::Handlers::Ruby::PublicClassMethodHandler < YARD::Handlers::Ruby::Base
|
|
4
|
+
include YARD::Handlers::Ruby::DecoratorHandlerMethods
|
|
5
|
+
|
|
6
|
+
handles method_call(:public_class_method)
|
|
7
|
+
namespace_only
|
|
8
|
+
|
|
9
|
+
process do
|
|
10
|
+
process_decorator :scope => :class do |method|
|
|
11
|
+
method.visibility = :public if method.respond_to? :visibility
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# Helper methods to parse @attr_* tags on a class.
|
|
3
|
+
#
|
|
4
|
+
# @deprecated The use of +@attr+ tags are deprecated since 0.8.0 in favour of
|
|
5
|
+
# the +@!attribute+ directive. This module should not be relied on.
|
|
6
|
+
# @since 0.5.6
|
|
7
|
+
module YARD::Handlers::Ruby::StructHandlerMethods
|
|
8
|
+
include YARD::CodeObjects
|
|
9
|
+
|
|
10
|
+
# Extracts the user's defined @member tag for a given class and its member. Returns
|
|
11
|
+
# nil if the user did not define a @member tag for this struct entry.
|
|
12
|
+
#
|
|
13
|
+
# @param [ClassObject] klass the class whose tags we're searching
|
|
14
|
+
# @param [String] member the name of the struct member we need
|
|
15
|
+
# @param [Symbol] type reader method, or writer method?
|
|
16
|
+
# @return [Tags::Tag, nil] the tag matching the request, or nil if not found
|
|
17
|
+
def member_tag_for_member(klass, member, type = :read)
|
|
18
|
+
specific_tag = type == :read ? :attr_reader : :attr_writer
|
|
19
|
+
(klass.tags(specific_tag) + klass.tags(:attr)).find {|tag| tag.name == member }
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Retrieves all members defined in @attr* tags
|
|
23
|
+
#
|
|
24
|
+
# @param [ClassObject] klass the class with the attributes
|
|
25
|
+
# @return [Array<String>] the list of members defined as attributes on the class
|
|
26
|
+
def members_from_tags(klass)
|
|
27
|
+
tags = klass.tags(:attr) + klass.tags(:attr_reader) + klass.tags(:attr_writer)
|
|
28
|
+
tags.map(&:name).uniq
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Determines whether to create an attribute method based on the class's
|
|
32
|
+
# tags.
|
|
33
|
+
#
|
|
34
|
+
# @param [ClassObject] klass the class whose tags we're searching
|
|
35
|
+
# @param [String] member the name of the struct member we need
|
|
36
|
+
# @param [Symbol] type (:read) reader method, or writer method?
|
|
37
|
+
# @return [Boolean] should the attribute be created?
|
|
38
|
+
def create_member_method?(klass, member, type = :read)
|
|
39
|
+
return true if (klass.tags(:attr) + klass.tags(:attr_reader) + klass.tags(:attr_writer)).empty?
|
|
40
|
+
return true if member_tag_for_member(klass, member, type)
|
|
41
|
+
return !member_tag_for_member(klass, member, :write) if type == :read
|
|
42
|
+
!member_tag_for_member(klass, member, :read)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Gets the return type for the member in a nicely formatted string. Used
|
|
46
|
+
# to be injected into auto-generated docstrings.
|
|
47
|
+
#
|
|
48
|
+
# @param [Tags::Tag] member_tag the tag object to check for types
|
|
49
|
+
# @return [String] the user-declared type of the struct member, or [Object] if
|
|
50
|
+
# the user did not define a type for this member.
|
|
51
|
+
def return_type_from_tag(member_tag)
|
|
52
|
+
member_tag && member_tag.types ? member_tag.types : "Object"
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Creates the auto-generated docstring for the getter method of a struct's
|
|
56
|
+
# member. This is used so the generated documentation will look just like that
|
|
57
|
+
# of an attribute defined using attr_accessor.
|
|
58
|
+
#
|
|
59
|
+
# @param [ClassObject] klass the class whose members we're working with
|
|
60
|
+
# @param [String] member the name of the member we're generating documentation for
|
|
61
|
+
# @return [String] a docstring to be attached to the getter method for this member
|
|
62
|
+
def add_reader_tags(klass, new_method, member)
|
|
63
|
+
member_tag = member_tag_for_member(klass, member, :read)
|
|
64
|
+
return_type = return_type_from_tag(member_tag)
|
|
65
|
+
getter_doc_text = member_tag ? member_tag.text : "Returns the value of attribute #{member}"
|
|
66
|
+
new_method.docstring.replace(getter_doc_text)
|
|
67
|
+
new_method.add_tag YARD::Tags::Tag.new(:return, "the current value of #{member}", return_type)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Creates the auto-generated docstring for the setter method of a struct's
|
|
71
|
+
# member. This is used so the generated documentation will look just like that
|
|
72
|
+
# of an attribute defined using attr_accessor.
|
|
73
|
+
#
|
|
74
|
+
# @param [ClassObject] klass the class whose members we're working with
|
|
75
|
+
# @param [String] member the name of the member we're generating documentation for
|
|
76
|
+
# @return [String] a docstring to be attached to the setter method for this member
|
|
77
|
+
def add_writer_tags(klass, new_method, member)
|
|
78
|
+
member_tag = member_tag_for_member(klass, member, :write)
|
|
79
|
+
return_type = return_type_from_tag(member_tag)
|
|
80
|
+
setter_doc_text = member_tag ? member_tag.text : "Sets the attribute #{member}"
|
|
81
|
+
new_method.docstring.replace(setter_doc_text)
|
|
82
|
+
new_method.add_tag YARD::Tags::Tag.new(:param, "the value to set the attribute #{member} to.", return_type, "value")
|
|
83
|
+
new_method.add_tag YARD::Tags::Tag.new(:return, "the newly set value", return_type)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Creates and registers a class object with the given name and superclass name.
|
|
87
|
+
# Returns it for further use.
|
|
88
|
+
#
|
|
89
|
+
# @param [String] classname the name of the class
|
|
90
|
+
# @param [String] superclass the name of the superclass
|
|
91
|
+
# @return [ClassObject] the class object for further processing/method attaching
|
|
92
|
+
def create_class(classname, superclass)
|
|
93
|
+
register ClassObject.new(namespace, classname) do |o|
|
|
94
|
+
o.superclass = superclass if superclass
|
|
95
|
+
o.superclass.type = :class if o.superclass.is_a?(Proxy)
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Creates the setter (writer) method and attaches it to the class as an attribute.
|
|
100
|
+
# Also sets up the docstring to prettify the documentation output.
|
|
101
|
+
#
|
|
102
|
+
# @param [ClassObject] klass the class to attach the method to
|
|
103
|
+
# @param [String] member the name of the member we're generating a method for
|
|
104
|
+
def create_writer(klass, member)
|
|
105
|
+
# We want to convert these members into attributes just like
|
|
106
|
+
# as if they were declared using attr_accessor.
|
|
107
|
+
new_meth = register MethodObject.new(klass, "#{member}=", :instance) do |o|
|
|
108
|
+
o.parameters = [['value', nil]]
|
|
109
|
+
o.signature ||= "def #{member}=(value)"
|
|
110
|
+
o.source ||= "#{o.signature}\n @#{member} = value\nend"
|
|
111
|
+
end
|
|
112
|
+
add_writer_tags(klass, new_meth, member)
|
|
113
|
+
klass.attributes[:instance][member][:write] = new_meth
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Creates the getter (reader) method and attaches it to the class as an attribute.
|
|
117
|
+
# Also sets up the docstring to prettify the documentation output.
|
|
118
|
+
#
|
|
119
|
+
# @param [ClassObject] klass the class to attach the method to
|
|
120
|
+
# @param [String] member the name of the member we're generating a method for
|
|
121
|
+
def create_reader(klass, member)
|
|
122
|
+
new_meth = register MethodObject.new(klass, member, :instance) do |o|
|
|
123
|
+
o.signature ||= "def #{member}"
|
|
124
|
+
o.source ||= "#{o.signature}\n @#{member}\nend"
|
|
125
|
+
end
|
|
126
|
+
add_reader_tags(klass, new_meth, member)
|
|
127
|
+
klass.attributes[:instance][member][:read] = new_meth
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Creates the given member methods and attaches them to the given ClassObject.
|
|
131
|
+
#
|
|
132
|
+
# @param [ClassObject] klass the class to generate attributes for
|
|
133
|
+
# @param [Array<String>] members a list of member names
|
|
134
|
+
def create_attributes(klass, members)
|
|
135
|
+
# For each parameter, add reader and writers
|
|
136
|
+
members.each do |member|
|
|
137
|
+
next if klass.attributes[:instance][member]
|
|
138
|
+
klass.attributes[:instance][member] = SymbolHash[:read => nil, :write => nil]
|
|
139
|
+
create_writer klass, member if create_member_method?(klass, member, :write)
|
|
140
|
+
create_reader klass, member if create_member_method?(klass, member, :read)
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# Handles 'private', 'protected', and 'public' calls.
|
|
3
|
+
class YARD::Handlers::Ruby::VisibilityHandler < YARD::Handlers::Ruby::Base
|
|
4
|
+
include YARD::Handlers::Ruby::DecoratorHandlerMethods
|
|
5
|
+
|
|
6
|
+
handles method_call(:private)
|
|
7
|
+
handles method_call(:protected)
|
|
8
|
+
handles method_call(:public)
|
|
9
|
+
namespace_only
|
|
10
|
+
|
|
11
|
+
process do
|
|
12
|
+
return if (ident = statement.jump(:ident)) == statement
|
|
13
|
+
case statement.type
|
|
14
|
+
when :var_ref, :vcall
|
|
15
|
+
self.visibility = ident.first.to_sym
|
|
16
|
+
globals.visibility_origin = :keyword
|
|
17
|
+
when :command
|
|
18
|
+
if RUBY_VERSION >= '3.' && is_attribute_method?(statement.parameters.first)
|
|
19
|
+
parse_block(statement.parameters.first, visibility: ident.first.to_sym)
|
|
20
|
+
return
|
|
21
|
+
end
|
|
22
|
+
process_decorator do |method|
|
|
23
|
+
method.visibility = ident.first if method.respond_to? :visibility=
|
|
24
|
+
end
|
|
25
|
+
when :fcall
|
|
26
|
+
process_decorator do |method|
|
|
27
|
+
method.visibility = ident.first if method.respond_to? :visibility=
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def is_attribute_method?(node)
|
|
33
|
+
node.type == :command && node.jump(:ident).first.to_s =~ /^attr_(accessor|writer|reader)$/
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# Handles 'yield' calls
|
|
3
|
+
class YARD::Handlers::Ruby::YieldHandler < YARD::Handlers::Ruby::Base
|
|
4
|
+
handles :yield, :yield0
|
|
5
|
+
|
|
6
|
+
process do
|
|
7
|
+
return unless owner.is_a?(MethodObject) # Only methods yield
|
|
8
|
+
return if owner.has_tag? :yield # Don't override yield tags
|
|
9
|
+
return if owner.has_tag? :yieldparam # Same thing.
|
|
10
|
+
|
|
11
|
+
yieldtag = YARD::Tags::Tag.new(:yield, "", [])
|
|
12
|
+
|
|
13
|
+
if statement.type == :yield
|
|
14
|
+
statement.jump(:list).children.each do |item|
|
|
15
|
+
if item == s(:var_ref, s(:kw, "self"))
|
|
16
|
+
yieldtag.types << '_self'
|
|
17
|
+
owner.add_tag YARD::Tags::Tag.new(:yieldparam,
|
|
18
|
+
"the object that the method was called on", owner.namespace.path, '_self')
|
|
19
|
+
elsif item == s(:zsuper)
|
|
20
|
+
yieldtag.types << '_super'
|
|
21
|
+
owner.add_tag YARD::Tags::Tag.new(:yieldparam,
|
|
22
|
+
"the result of the method from the superclass", nil, '_super')
|
|
23
|
+
else
|
|
24
|
+
yieldtag.types << item.source
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
owner.add_tag(yieldtag) unless yieldtag.types.empty?
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
module YARD
|
|
3
|
+
module I18n
|
|
4
|
+
# +Locale+ is a unit of translation. It has {#name} and a set of
|
|
5
|
+
# messages.
|
|
6
|
+
#
|
|
7
|
+
# @since 0.8.2
|
|
8
|
+
class Locale
|
|
9
|
+
class << self
|
|
10
|
+
# @return [String, nil] the default locale name.
|
|
11
|
+
# @since 0.8.4
|
|
12
|
+
attr_accessor :default
|
|
13
|
+
|
|
14
|
+
undef default
|
|
15
|
+
def default
|
|
16
|
+
@@default ||= nil
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
undef default=
|
|
20
|
+
def default=(locale)
|
|
21
|
+
@@default = locale
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# @return [String] the name of the locale. It used IETF language
|
|
26
|
+
# tag format +[language[_territory][.codeset][@modifier]]+.
|
|
27
|
+
# @see https://tools.ietf.org/rfc/bcp/bcp47.txt
|
|
28
|
+
# BCP 47 - Tags for Identifying Languages
|
|
29
|
+
attr_reader :name
|
|
30
|
+
|
|
31
|
+
# Creates a locale for +name+ locale.
|
|
32
|
+
#
|
|
33
|
+
# @param [String] name the locale name.
|
|
34
|
+
def initialize(name)
|
|
35
|
+
@name = name
|
|
36
|
+
@messages = {}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Loads translation messages from +locale_directory+/{#name}.po.
|
|
40
|
+
#
|
|
41
|
+
# @param [String] locale_directory the directory path that has
|
|
42
|
+
# {#name}.po.
|
|
43
|
+
# @return [Boolean] +true+ if PO file exists, +false+ otherwise.
|
|
44
|
+
def load(locale_directory)
|
|
45
|
+
return false if @name.nil?
|
|
46
|
+
|
|
47
|
+
po_file = File.join(locale_directory, "#{@name}.po")
|
|
48
|
+
return false unless File.exist?(po_file)
|
|
49
|
+
|
|
50
|
+
require "yard/i18n/po_parser"
|
|
51
|
+
return false unless POParser.available?
|
|
52
|
+
|
|
53
|
+
po_parser = POParser.new
|
|
54
|
+
@messages.merge!(po_parser.parse(po_file))
|
|
55
|
+
|
|
56
|
+
true
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# @param [String] message the translation target message.
|
|
60
|
+
# @return [String] translated message. If translation isn't
|
|
61
|
+
# registered, the +message+ is returned.
|
|
62
|
+
def translate(message)
|
|
63
|
+
@messages[message] || message
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
require "set"
|
|
3
|
+
|
|
4
|
+
module YARD
|
|
5
|
+
module I18n
|
|
6
|
+
# +Message+ is a translation target message. It has message ID as
|
|
7
|
+
# {#id} and some properties {#locations} and {#comments}.
|
|
8
|
+
#
|
|
9
|
+
# @since 0.8.1
|
|
10
|
+
class Message
|
|
11
|
+
# @return [String] the message ID of the translation target message.
|
|
12
|
+
attr_reader :id
|
|
13
|
+
|
|
14
|
+
# @return [Set] the set of locations. Location is an array of
|
|
15
|
+
# path and line number where the message is appeared.
|
|
16
|
+
attr_reader :locations
|
|
17
|
+
|
|
18
|
+
# @return [Set] the set of comments for the messages.
|
|
19
|
+
attr_reader :comments
|
|
20
|
+
|
|
21
|
+
# Creates a translate target message for message ID +id+.
|
|
22
|
+
#
|
|
23
|
+
# @param [String] id the message ID of the translate target message.
|
|
24
|
+
def initialize(id)
|
|
25
|
+
@id = id
|
|
26
|
+
@locations = Set.new
|
|
27
|
+
@comments = Set.new
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Adds location information for the message.
|
|
31
|
+
#
|
|
32
|
+
# @param [String] path the path where the message appears.
|
|
33
|
+
# @param [Integer] line the line number where the message appears.
|
|
34
|
+
# @return [void]
|
|
35
|
+
def add_location(path, line)
|
|
36
|
+
@locations << [path, line]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Adds a comment for the message.
|
|
40
|
+
#
|
|
41
|
+
# @param [String] comment the comment for the message to be added.
|
|
42
|
+
# @return [void]
|
|
43
|
+
def add_comment(comment)
|
|
44
|
+
@comments << comment unless comment.nil?
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# @param [Message] other the +Message+ to be compared.
|
|
48
|
+
# @return [Boolean] checks whether this message is equal to another.
|
|
49
|
+
def ==(other)
|
|
50
|
+
other.is_a?(self.class) &&
|
|
51
|
+
@id == other.id &&
|
|
52
|
+
@locations == other.locations &&
|
|
53
|
+
@comments == other.comments
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
module YARD
|
|
3
|
+
module I18n
|
|
4
|
+
# Acts as a container for {Message} objects.
|
|
5
|
+
#
|
|
6
|
+
# @since 0.8.1
|
|
7
|
+
class Messages
|
|
8
|
+
include Enumerable
|
|
9
|
+
|
|
10
|
+
# Creates a new container.
|
|
11
|
+
def initialize
|
|
12
|
+
@messages = {}
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Enumerates each {Message} in the container.
|
|
16
|
+
#
|
|
17
|
+
# @yieldparam [Message] message the next message object in
|
|
18
|
+
# the enumeration.
|
|
19
|
+
# @return [void]
|
|
20
|
+
def each(&block)
|
|
21
|
+
@messages.each_value(&block)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# @param [String] id the message ID to perform a lookup on.
|
|
25
|
+
# @return [Message, nil] a registered message for the given +id+,
|
|
26
|
+
# or nil if no message for the ID is found.
|
|
27
|
+
def [](id)
|
|
28
|
+
@messages[id]
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Registers a {Message}, the message ID of which is +id+. If
|
|
32
|
+
# corresponding +Message+ is already registered, the previously
|
|
33
|
+
# registered object is returned.
|
|
34
|
+
#
|
|
35
|
+
# @param [String] id the ID of the message to be registered.
|
|
36
|
+
# @return [Message] the registered +Message+.
|
|
37
|
+
def register(id)
|
|
38
|
+
@messages[id] ||= Message.new(id)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Checks if this messages list is equal to another messages list.
|
|
42
|
+
#
|
|
43
|
+
# @param [Messages] other the container to compare.
|
|
44
|
+
# @return [Boolean] whether +self+ and +other+ is equivalence or not.
|
|
45
|
+
def ==(other)
|
|
46
|
+
other.is_a?(self.class) &&
|
|
47
|
+
@messages == other.messages
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
protected
|
|
51
|
+
|
|
52
|
+
# @return [Hash{String=>Message}] the set of message objects
|
|
53
|
+
attr_reader :messages
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
module YARD
|
|
3
|
+
module I18n
|
|
4
|
+
# +Locale+ is a wrapper for gettext's PO parsing feature. It hides
|
|
5
|
+
# gettext API difference from YARD.
|
|
6
|
+
#
|
|
7
|
+
# @since 0.8.8
|
|
8
|
+
class POParser
|
|
9
|
+
if RUBY_VERSION < "1.9"
|
|
10
|
+
begin
|
|
11
|
+
require "gettext/tools/poparser"
|
|
12
|
+
require "gettext/runtime/mofile"
|
|
13
|
+
@@gettext_version = 2
|
|
14
|
+
rescue LoadError
|
|
15
|
+
log.warn "Need gettext gem 2.x for i18n feature:\n" \
|
|
16
|
+
"\tgem install gettext -v 2.3.9"
|
|
17
|
+
end
|
|
18
|
+
else
|
|
19
|
+
begin
|
|
20
|
+
require "gettext/po_parser"
|
|
21
|
+
require "gettext/mo"
|
|
22
|
+
@@gettext_version = 3
|
|
23
|
+
rescue LoadError
|
|
24
|
+
begin
|
|
25
|
+
require "gettext/tools/poparser"
|
|
26
|
+
require "gettext/runtime/mofile"
|
|
27
|
+
@@gettext_version = 2
|
|
28
|
+
rescue LoadError
|
|
29
|
+
log.warn "Need gettext gem for i18n feature:\n" \
|
|
30
|
+
"\tgem install gettext"
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
class << self
|
|
36
|
+
# @return [Boolean] true if gettext is available, false otherwise.
|
|
37
|
+
def available?
|
|
38
|
+
!@@gettext_version.nil?
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Parses PO file.
|
|
43
|
+
#
|
|
44
|
+
# @param [String] file path of PO file to be parsed.
|
|
45
|
+
# @return [Hash<String, String>] parsed messages.
|
|
46
|
+
def parse(file)
|
|
47
|
+
case @@gettext_version
|
|
48
|
+
when 2
|
|
49
|
+
parser = GetText::PoParser.new
|
|
50
|
+
data = GetText::MoFile.new
|
|
51
|
+
when 3
|
|
52
|
+
parser = GetText::POParser.new
|
|
53
|
+
data = GetText::MO.new
|
|
54
|
+
end
|
|
55
|
+
parser.report_warning = false
|
|
56
|
+
parser.parse_file(file, data)
|
|
57
|
+
data
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|