nutshell-crm 0.0.1 → 0.0.2
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.
- data/Rakefile +4 -1
- data/lib/nutshell-crm.rb +274 -6
- data/lib/nutshell-crm/version.rb +1 -1
- data/nutshell-crm.gemspec +1 -0
- data/spec/nutshell-crm_spec.rb +40 -167
- data/vendor/bundle/bin/yard +19 -0
- data/vendor/bundle/bin/yardoc +19 -0
- data/vendor/bundle/bin/yri +19 -0
- data/vendor/bundle/gems/yard-0.7.4/.yardopts +18 -0
- data/vendor/bundle/gems/yard-0.7.4/ChangeLog +10533 -0
- data/vendor/bundle/gems/yard-0.7.4/LEGAL +74 -0
- data/vendor/bundle/gems/yard-0.7.4/LICENSE +22 -0
- data/vendor/bundle/gems/yard-0.7.4/README.md +514 -0
- data/vendor/bundle/gems/yard-0.7.4/Rakefile +99 -0
- data/vendor/bundle/gems/yard-0.7.4/benchmarks/builtins_vs_eval.rb +23 -0
- data/vendor/bundle/gems/yard-0.7.4/benchmarks/concat_vs_join.rb +12 -0
- data/vendor/bundle/gems/yard-0.7.4/benchmarks/erb_vs_erubis.rb +53 -0
- data/vendor/bundle/gems/yard-0.7.4/benchmarks/format_args.rb +46 -0
- data/vendor/bundle/gems/yard-0.7.4/benchmarks/generation.rb +37 -0
- data/vendor/bundle/gems/yard-0.7.4/benchmarks/marshal_vs_dbm.rb +63 -0
- data/vendor/bundle/gems/yard-0.7.4/benchmarks/parsing.rb +46 -0
- data/vendor/bundle/gems/yard-0.7.4/benchmarks/pathname_vs_string.rb +50 -0
- data/vendor/bundle/gems/yard-0.7.4/benchmarks/rdoc_vs_yardoc.rb +10 -0
- data/vendor/bundle/gems/yard-0.7.4/benchmarks/ri_vs_yri.rb +18 -0
- data/vendor/bundle/gems/yard-0.7.4/benchmarks/ripper_parser.rb +12 -0
- data/vendor/bundle/gems/yard-0.7.4/benchmarks/splat_vs_flatten.rb +12 -0
- data/vendor/bundle/gems/yard-0.7.4/benchmarks/template_erb.rb +22 -0
- data/vendor/bundle/gems/yard-0.7.4/benchmarks/template_format.rb +6 -0
- data/vendor/bundle/gems/yard-0.7.4/benchmarks/template_profile.rb +17 -0
- data/vendor/bundle/gems/yard-0.7.4/benchmarks/yri_cache.rb +19 -0
- data/vendor/bundle/gems/yard-0.7.4/bin/yard +4 -0
- data/vendor/bundle/gems/yard-0.7.4/bin/yard-graph +4 -0
- data/vendor/bundle/gems/yard-0.7.4/bin/yard-server +4 -0
- data/vendor/bundle/gems/yard-0.7.4/bin/yardoc +4 -0
- data/vendor/bundle/gems/yard-0.7.4/bin/yri +4 -0
- data/vendor/bundle/gems/yard-0.7.4/docs/CodeObjects.md +115 -0
- data/vendor/bundle/gems/yard-0.7.4/docs/GettingStarted.md +590 -0
- data/vendor/bundle/gems/yard-0.7.4/docs/Glossary.md +12 -0
- data/vendor/bundle/gems/yard-0.7.4/docs/Handlers.md +152 -0
- data/vendor/bundle/gems/yard-0.7.4/docs/Overview.md +61 -0
- data/vendor/bundle/gems/yard-0.7.4/docs/Parser.md +191 -0
- data/vendor/bundle/gems/yard-0.7.4/docs/Tags.md +586 -0
- data/vendor/bundle/gems/yard-0.7.4/docs/Templates.md +518 -0
- data/vendor/bundle/gems/yard-0.7.4/docs/WhatsNew.md +887 -0
- data/vendor/bundle/gems/yard-0.7.4/docs/images/code-objects-class-diagram.png +0 -0
- data/vendor/bundle/gems/yard-0.7.4/docs/images/handlers-class-diagram.png +0 -0
- data/vendor/bundle/gems/yard-0.7.4/docs/images/overview-class-diagram.png +0 -0
- data/vendor/bundle/gems/yard-0.7.4/docs/images/parser-class-diagram.png +0 -0
- data/vendor/bundle/gems/yard-0.7.4/docs/images/tags-class-diagram.png +0 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/rubygems_plugin.rb +4 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard.rb +57 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/autoload.rb +233 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/cli/command.rb +73 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/cli/command_parser.rb +89 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/cli/config.rb +136 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/cli/diff.rb +201 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/cli/gems.rb +83 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/cli/graph.rb +103 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/cli/help.rb +18 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/cli/list.rb +22 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/cli/server.rb +160 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/cli/stats.rb +210 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/cli/yardoc.rb +696 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/cli/yri.rb +193 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/code_objects/base.rb +513 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/code_objects/class_object.rb +143 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/code_objects/class_variable_object.rb +8 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/code_objects/constant_object.rb +13 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/code_objects/extended_method_object.rb +23 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/code_objects/extra_file_object.rb +89 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/code_objects/macro_object.rb +215 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/code_objects/method_object.rb +153 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/code_objects/module_object.rb +18 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/code_objects/namespace_object.rb +200 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/code_objects/proxy.rb +252 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/code_objects/root_object.rb +16 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/config.rb +259 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/core_ext/array.rb +15 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/core_ext/file.rb +65 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/core_ext/hash.rb +15 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/core_ext/insertion.rb +60 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/core_ext/module.rb +19 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/core_ext/string.rb +67 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/core_ext/symbol_hash.rb +73 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/docstring.rb +331 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/globals.rb +18 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/base.rb +569 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/processor.rb +187 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/alias_handler.rb +43 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/attribute_handler.rb +83 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/base.rb +160 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/class_condition_handler.rb +84 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/class_handler.rb +122 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/class_variable_handler.rb +16 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/constant_handler.rb +45 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/exception_handler.rb +26 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/extend_handler.rb +21 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/legacy/alias_handler.rb +37 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/legacy/attribute_handler.rb +61 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/legacy/base.rb +228 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/legacy/class_condition_handler.rb +81 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/legacy/class_handler.rb +110 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/legacy/class_variable_handler.rb +14 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/legacy/constant_handler.rb +28 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/legacy/exception_handler.rb +12 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/legacy/extend_handler.rb +20 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/legacy/macro_handler.rb +39 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/legacy/method_handler.rb +78 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/legacy/mixin_handler.rb +41 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/legacy/module_handler.rb +11 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/legacy/private_constant_handler.rb +21 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/legacy/visibility_handler.rb +16 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/legacy/yield_handler.rb +28 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/macro_handler.rb +40 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/macro_handler_methods.rb +130 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/method_condition_handler.rb +8 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/method_handler.rb +94 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/mixin_handler.rb +36 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/module_handler.rb +11 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/private_constant_handler.rb +36 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/struct_handler_methods.rb +140 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/visibility_handler.rb +24 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/handlers/ruby/yield_handler.rb +30 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/logging.rb +77 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/parser/base.rb +56 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/parser/c_parser.rb +501 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/parser/ruby/ast_node.rb +399 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/parser/ruby/legacy/ruby_lex.rb +1376 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/parser/ruby/legacy/ruby_parser.rb +30 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/parser/ruby/legacy/statement.rb +60 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/parser/ruby/legacy/statement_list.rb +390 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/parser/ruby/legacy/token_list.rb +66 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/parser/ruby/ruby_parser.rb +542 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/parser/source_parser.rb +517 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/rake/yardoc_task.rb +75 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/registry.rb +400 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/registry_store.rb +252 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/rubygems/backports.rb +8 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/rubygems/backports/LICENSE.txt +57 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/rubygems/backports/MIT.txt +20 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/rubygems/backports/gem.rb +8 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/rubygems/backports/source_index.rb +353 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/rubygems/doc_manager.rb +75 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/rubygems/specification.rb +41 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/serializers/base.rb +80 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/serializers/file_system_serializer.rb +92 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/serializers/process_serializer.rb +24 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/serializers/stdout_serializer.rb +32 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/serializers/yardoc_serializer.rb +122 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server.rb +11 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/adapter.rb +100 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/commands/base.rb +192 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/commands/display_file_command.rb +24 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/commands/display_object_command.rb +51 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/commands/frames_command.rb +32 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/commands/library_command.rb +100 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/commands/library_index_command.rb +24 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/commands/list_command.rb +48 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/commands/search_command.rb +72 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/commands/static_file_command.rb +50 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/doc_server_helper.rb +40 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/doc_server_serializer.rb +31 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/library_version.rb +227 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/rack_adapter.rb +83 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/router.rb +180 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/static_caching.rb +45 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/default/fulldoc/html/css/custom.css +78 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/default/fulldoc/html/images/processing.gif +0 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/default/fulldoc/html/js/autocomplete.js +12 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/default/fulldoc/html/js/live.js +32 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/default/layout/html/breadcrumb.erb +46 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/default/layout/html/headers.erb +16 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/default/layout/html/setup.rb +7 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/doc_server/frames/html/frames.erb +13 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/doc_server/frames/html/setup.rb +3 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/doc_server/full_list/html/full_list.erb +34 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/doc_server/full_list/html/setup.rb +20 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/doc_server/library_list/html/contents.erb +13 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/doc_server/library_list/html/headers.erb +26 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/doc_server/library_list/html/library_list.erb +12 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/doc_server/library_list/html/setup.rb +3 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/doc_server/library_list/html/title.erb +2 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/doc_server/processing/html/processing.erb +51 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/doc_server/processing/html/setup.rb +3 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/doc_server/search/html/search.erb +19 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/templates/doc_server/search/html/setup.rb +8 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/server/webrick_adapter.rb +42 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/tags/default_factory.rb +141 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/tags/default_tag.rb +12 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/tags/library.rb +201 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/tags/option_tag.rb +12 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/tags/overload_tag.rb +65 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/tags/ref_tag.rb +7 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/tags/ref_tag_list.rb +27 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/tags/tag.rb +57 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/tags/tag_format_error.rb +6 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/templates/engine.rb +173 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/templates/erb_cache.rb +22 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/templates/helpers/base_helper.rb +206 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/templates/helpers/filter_helper.rb +26 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/templates/helpers/html_helper.rb +520 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/templates/helpers/html_syntax_highlight_helper.rb +59 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/templates/helpers/markup/rdoc_markup.rb +85 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/templates/helpers/markup_helper.rb +164 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/templates/helpers/method_helper.rb +72 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/templates/helpers/module_helper.rb +19 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/templates/helpers/text_helper.rb +95 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/templates/helpers/uml_helper.rb +46 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/templates/section.rb +106 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/templates/template.rb +366 -0
- data/vendor/bundle/gems/yard-0.7.4/lib/yard/verifier.rb +148 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/cli/command_parser_spec.rb +43 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/cli/command_spec.rb +36 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/cli/config_spec.rb +92 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/cli/diff_spec.rb +172 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/cli/gems_spec.rb +81 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/cli/help_spec.rb +22 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/cli/list_spec.rb +8 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/cli/server_spec.rb +171 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/cli/stats_spec.rb +90 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/cli/yardoc_spec.rb +628 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/cli/yri_spec.rb +87 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/code_objects/base_spec.rb +334 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/code_objects/class_object_spec.rb +225 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/code_objects/code_object_list_spec.rb +33 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/code_objects/constants_spec.rb +81 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/code_objects/extra_file_object_spec.rb +132 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/code_objects/macro_object_spec.rb +154 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/code_objects/method_object_spec.rb +152 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/code_objects/module_object_spec.rb +141 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/code_objects/namespace_object_spec.rb +170 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/code_objects/proxy_spec.rb +124 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/code_objects/spec_helper.rb +3 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/config_spec.rb +167 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/core_ext/array_spec.rb +14 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/core_ext/file_spec.rb +68 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/core_ext/hash_spec.rb +14 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/core_ext/insertion_spec.rb +37 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/core_ext/module_spec.rb +15 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/core_ext/string_spec.rb +42 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/core_ext/symbol_hash_spec.rb +86 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/docstring_spec.rb +400 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/alias_handler_spec.rb +80 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/attribute_handler_spec.rb +94 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/base_spec.rb +197 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/class_condition_handler_spec.rb +62 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/class_handler_spec.rb +246 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/class_variable_handler_spec.rb +11 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/constant_handler_spec.rb +64 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/examples/alias_handler_001.rb.txt +44 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/examples/attribute_handler_001.rb.txt +32 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/examples/class_condition_handler_001.rb.txt +61 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/examples/class_handler_001.rb.txt +120 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/examples/class_variable_handler_001.rb.txt +10 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/examples/constant_handler_001.rb.txt +25 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/examples/exception_handler_001.rb.txt +59 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/examples/extend_handler_001.rb.txt +16 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/examples/macro_handler_001.rb.txt +83 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/examples/method_condition_handler_001.rb.txt +10 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/examples/method_handler_001.rb.txt +122 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/examples/mixin_handler_001.rb.txt +33 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/examples/module_handler_001.rb.txt +29 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/examples/private_constant_handler_001.rb.txt +8 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/examples/process_handler_001.rb.txt +11 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/examples/visibility_handler_001.rb.txt +27 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/examples/yield_handler_001.rb.txt +55 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/exception_handler_spec.rb +48 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/extend_handler_spec.rb +23 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/legacy_base_spec.rb +128 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/macro_handler_spec.rb +157 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/method_condition_handler_spec.rb +14 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/method_handler_spec.rb +177 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/mixin_handler_spec.rb +50 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/module_handler_spec.rb +34 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/private_constant_handler_spec.rb +24 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/processor_spec.rb +23 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/ruby/base_spec.rb +90 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/ruby/legacy/base_spec.rb +78 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/spec_helper.rb +34 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/visibility_handler_spec.rb +34 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/handlers/yield_handler_spec.rb +51 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/logging_spec.rb +14 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/parser/base_spec.rb +24 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/parser/c_parser_spec.rb +231 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/parser/examples/array.c.txt +3887 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/parser/examples/example1.rb.txt +8 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/parser/examples/extrafile.c.txt +8 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/parser/examples/multifile.c.txt +6 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/parser/examples/override.c.txt +424 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/parser/examples/parse_in_order_001.rb.txt +2 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/parser/examples/parse_in_order_002.rb.txt +2 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/parser/examples/tag_handler_001.rb.txt +8 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/parser/ruby/ast_node_spec.rb +33 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/parser/ruby/legacy/statement_list_spec.rb +299 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/parser/ruby/legacy/token_list_spec.rb +69 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/parser/ruby/ruby_parser_spec.rb +257 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/parser/source_parser_spec.rb +595 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/parser/tag_parsing_spec.rb +18 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/rake/yardoc_task_spec.rb +90 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/registry_spec.rb +303 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/registry_store_spec.rb +255 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/serializers/data/serialized_yardoc/checksums +1 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/serializers/data/serialized_yardoc/objects/Foo.dat +0 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/serializers/data/serialized_yardoc/objects/Foo/bar_i.dat +0 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/serializers/data/serialized_yardoc/objects/Foo/baz_i.dat +0 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/serializers/data/serialized_yardoc/objects/root.dat +0 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/serializers/data/serialized_yardoc/proxy_types +2 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/serializers/file_system_serializer_spec.rb +124 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/serializers/spec_helper.rb +2 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/serializers/yardoc_serializer_spec.rb +46 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/server/adapter_spec.rb +38 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/server/commands/base_spec.rb +87 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/server/commands/library_command_spec.rb +39 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/server/commands/static_file_command_spec.rb +84 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/server/doc_server_serializer_spec.rb +58 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/server/rack_adapter_spec.rb +18 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/server/router_spec.rb +115 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/server/spec_helper.rb +17 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/server/static_caching_spec.rb +39 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/server/webrick_servlet_spec.rb +20 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/server_spec.rb +10 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/spec_helper.rb +105 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/tags/default_factory_spec.rb +138 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/tags/default_tag_spec.rb +11 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/tags/library_spec.rb +23 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/tags/overload_tag_spec.rb +53 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/tags/ref_tag_list_spec.rb +53 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/class_spec.rb +43 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/constant_spec.rb +40 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/engine_spec.rb +129 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/class001.html +280 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/class001.txt +36 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/class002.html +35 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/constant001.txt +25 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/constant002.txt +7 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/constant003.txt +11 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/method001.html +130 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/method001.txt +35 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/method002.html +86 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/method002.txt +20 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/method003.html +159 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/method003.txt +45 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/method004.html +44 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/method004.txt +10 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/method005.html +99 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/method005.txt +33 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/module001.dot +33 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/module001.html +795 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/module001.txt +33 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/module002.html +319 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/examples/tag001.txt +82 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/helpers/base_helper_spec.rb +175 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/helpers/html_helper_spec.rb +541 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/helpers/html_syntax_highlight_helper_spec.rb +48 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/helpers/markup/rdoc_markup_spec.rb +84 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/helpers/markup_helper_spec.rb +132 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/helpers/method_helper_spec.rb +75 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/helpers/shared_signature_examples.rb +121 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/helpers/text_helper_spec.rb +44 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/method_spec.rb +102 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/module_spec.rb +109 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/onefile_spec.rb +47 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/section_spec.rb +146 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/spec_helper.rb +42 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/tag_spec.rb +39 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/templates/template_spec.rb +401 -0
- data/vendor/bundle/gems/yard-0.7.4/spec/verifier_spec.rb +86 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/class/dot/setup.rb +6 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/class/dot/superklass.erb +3 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/class/html/constructor_details.erb +8 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/class/html/setup.rb +1 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/class/html/subclasses.erb +4 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/class/setup.rb +36 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/class/text/setup.rb +11 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/class/text/subclasses.erb +5 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/constant/text/header.erb +11 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/constant/text/setup.rb +3 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/docstring/html/abstract.erb +4 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/docstring/html/deprecated.erb +1 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/docstring/html/index.erb +5 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/docstring/html/note.erb +6 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/docstring/html/private.erb +4 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/docstring/html/returns_void.erb +1 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/docstring/html/text.erb +1 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/docstring/html/todo.erb +6 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/docstring/setup.rb +49 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/docstring/text/abstract.erb +2 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/docstring/text/deprecated.erb +2 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/docstring/text/index.erb +2 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/docstring/text/note.erb +4 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/docstring/text/private.erb +2 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/docstring/text/returns_void.erb +1 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/docstring/text/text.erb +1 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/docstring/text/todo.erb +4 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/fulldoc/html/css/common.css +1 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/fulldoc/html/css/full_list.css +55 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/fulldoc/html/css/style.css +322 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/fulldoc/html/frames.erb +13 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/fulldoc/html/full_list.erb +37 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/fulldoc/html/full_list_class.erb +2 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/fulldoc/html/full_list_files.erb +5 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/fulldoc/html/full_list_methods.erb +12 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/fulldoc/html/js/app.js +205 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/fulldoc/html/js/full_list.js +167 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/fulldoc/html/js/jquery.js +16 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/fulldoc/html/setup.rb +198 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/layout/dot/header.erb +6 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/layout/dot/setup.rb +14 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/layout/html/breadcrumb.erb +13 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/layout/html/files.erb +11 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/layout/html/footer.erb +5 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/layout/html/headers.erb +17 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/layout/html/index.erb +2 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/layout/html/layout.erb +24 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/layout/html/listing.erb +4 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/layout/html/objects.erb +32 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/layout/html/search.erb +5 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/layout/html/setup.rb +71 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/method/html/header.erb +16 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/method/setup.rb +3 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/method/text/header.erb +1 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/method_details/html/header.erb +3 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/method_details/html/method_signature.erb +18 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/method_details/html/source.erb +10 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/method_details/setup.rb +9 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/method_details/text/header.erb +10 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/method_details/text/method_signature.erb +12 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/method_details/text/setup.rb +10 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/dot/child.erb +1 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/dot/dependencies.erb +3 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/dot/header.erb +6 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/dot/info.erb +14 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/dot/setup.rb +14 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/html/attribute_details.erb +11 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/html/attribute_summary.erb +8 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/html/box_info.erb +37 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/html/children.erb +8 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/html/constant_summary.erb +13 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/html/defines.erb +3 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/html/header.erb +5 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/html/inherited_attributes.erb +17 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/html/inherited_constants.erb +8 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/html/inherited_methods.erb +18 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/html/item_summary.erb +30 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/html/method_details_list.erb +9 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/html/method_summary.erb +14 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/html/methodmissing.erb +12 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/html/pre_docstring.erb +1 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/setup.rb +129 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/text/children.erb +10 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/text/class_meths_list.erb +8 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/text/extends.erb +8 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/text/header.erb +7 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/text/includes.erb +8 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/text/instance_meths_list.erb +8 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/module/text/setup.rb +12 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/onefile/html/files.erb +5 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/onefile/html/layout.erb +22 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/onefile/html/readme.erb +3 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/onefile/html/setup.rb +43 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/root/dot/child.erb +3 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/root/dot/setup.rb +5 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/root/html/setup.rb +1 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/tags/html/example.erb +9 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/tags/html/index.erb +3 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/tags/html/option.erb +22 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/tags/html/overload.erb +14 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/tags/html/see.erb +8 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/tags/html/tag.erb +20 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/tags/setup.rb +50 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/tags/text/example.erb +12 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/tags/text/index.erb +1 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/tags/text/option.erb +20 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/tags/text/overload.erb +19 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/tags/text/see.erb +11 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/default/tags/text/tag.erb +13 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/guide/class/html/setup.rb +1 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/guide/docstring/html/setup.rb +1 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/guide/fulldoc/html/css/style.css +93 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/guide/fulldoc/html/js/app.js +33 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/guide/fulldoc/html/setup.rb +54 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/guide/layout/html/layout.erb +81 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/guide/layout/html/setup.rb +24 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/guide/method/html/header.erb +18 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/guide/method/html/setup.rb +21 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/guide/module/html/header.erb +7 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/guide/module/html/method_list.erb +5 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/guide/module/html/setup.rb +26 -0
- data/vendor/bundle/gems/yard-0.7.4/templates/guide/tags/html/setup.rb +8 -0
- data/vendor/bundle/specifications/yard-0.7.4.gemspec +28 -0
- metadata +505 -8
@@ -0,0 +1,12 @@
|
|
1
|
+
# Glossary
|
2
|
+
|
3
|
+
* **Code Object**: Any explicitly defined Ruby source that describes a feature
|
4
|
+
of the code. By default, this refers to classes, modules, methods, constants
|
5
|
+
and class variables, though it can be extended to refer to custom functionality
|
6
|
+
defined by a DSL (like a spec, for instance).
|
7
|
+
|
8
|
+
* **Domain Specific Language (DSL)**: In the context of Ruby, a DSL is a languge
|
9
|
+
optimized for a specific domain (problem) but represented using Ruby syntax.
|
10
|
+
|
11
|
+
* **Docstring (Documentation String)**: Comments associated with a code object
|
12
|
+
used for documentation purposes.
|
@@ -0,0 +1,152 @@
|
|
1
|
+
# @title Handlers Architecture
|
2
|
+
|
3
|
+
# Handlers Architecture
|
4
|
+
|
5
|
+
Handlers allow the processing of parsed source code. Handling is done after
|
6
|
+
parsing to abstract away the implementation details of lexical and semantic
|
7
|
+
analysis on source and to only deal with the logic regarding recognizing
|
8
|
+
source statements as {file:docs/CodeObjects.md code objects}.
|
9
|
+
|
10
|
+

|
11
|
+
|
12
|
+
## The Pipeline
|
13
|
+
|
14
|
+
After the {file:docs/Parser.md parser component} finishes analyzing the
|
15
|
+
source, it is handed off for post-processing to the {YARD::Handlers::Processor}
|
16
|
+
class, which is responsible for traversing the set of statements given by
|
17
|
+
the parser and delegating them to matching handlers. Handlers match when the
|
18
|
+
{YARD::Handlers::Base.handles?} method returns true for a given statement.
|
19
|
+
The handler can then perform any action after being invoked by the `process`
|
20
|
+
method.
|
21
|
+
|
22
|
+
## The Processor Class
|
23
|
+
|
24
|
+
The main purpose of the processor, as mentioned above, is to traverse through
|
25
|
+
the list of statements given to it by the parser. The processor also keeps
|
26
|
+
state about what is being processed. For instance, the processor is what keeps
|
27
|
+
track of the current namespace (the module or class an object is being defined
|
28
|
+
in), scope (class or instance), file and owner. The owner refers to the object
|
29
|
+
that is most directly responsible for the source statement being processed. This
|
30
|
+
is most often the same as the namespace, except when parsing the body of a method,
|
31
|
+
where the namespace would be the class/module the method is defined in and the
|
32
|
+
owner would be the method object itself.
|
33
|
+
|
34
|
+
## Implementing a Handler
|
35
|
+
|
36
|
+
This section covers the basics of implementing a *new-style* Ruby handler. For
|
37
|
+
details on implementing a legacy handler, see the "API Differences" section below.
|
38
|
+
|
39
|
+
a Ruby handler can be implemented simply by subclassing the {YARD::Handlers::Ruby::Base}
|
40
|
+
class and declaring what node types or source to process with the {YARD::Handlers::Base.handles handles}
|
41
|
+
class method. A very simple handler that handles a module definition would be:
|
42
|
+
|
43
|
+
class MyModuleHandler < YARD::Handlers::Ruby::Base
|
44
|
+
handles :module
|
45
|
+
|
46
|
+
def process
|
47
|
+
puts "Handling a module named #{statement[0].source}"
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
For details on what nodes are, and what node types are, see the
|
52
|
+
{file:docs/Parser.md parser architecture document}.
|
53
|
+
|
54
|
+
In this case the node type being handled is the `:module` type. More than one
|
55
|
+
node type or `handles` declarations may describe a single handler, for instance,
|
56
|
+
a handler that handles class definitions should handle the `:class` and `:sclass`
|
57
|
+
node types respectively (the latter refers to classes defined as `class << Something`).
|
58
|
+
The {YARD::Handlers::Base#statement statement} attribute refers to the current
|
59
|
+
node (or statement) that is being handled by the handler.
|
60
|
+
|
61
|
+
### Handling a Method Call
|
62
|
+
|
63
|
+
In some cases, a developer might need to handle a method call. The parser can
|
64
|
+
express a method call in many AST forms, so to simplify this process, a method
|
65
|
+
call can be handled by declaring the following in a `handles` statement:
|
66
|
+
|
67
|
+
class MyHandler < YARD::Handlers::Ruby::Base
|
68
|
+
handles method_call(:describe)
|
69
|
+
|
70
|
+
def process
|
71
|
+
# Process the method call
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
In this case we handle any of the method calls to method name `describe` with
|
76
|
+
the following syntaxes:
|
77
|
+
|
78
|
+
describe(something)
|
79
|
+
describe arg1, arg2, arg3
|
80
|
+
describe(something) { perform_a_block }
|
81
|
+
describe "Something" do
|
82
|
+
a_block
|
83
|
+
end
|
84
|
+
|
85
|
+
### Creating a new Code Object
|
86
|
+
|
87
|
+
Usually (but not always) handling is performed to create new code objects to add
|
88
|
+
to the registry (for information about code objects, see {file:docs/CodeObjects.md this document}).
|
89
|
+
Code objects should simply be created and added to the existing `namespace`. This
|
90
|
+
will be enough to add them to the registry. There is also a convenience
|
91
|
+
{YARD::Handlers::Base#register register} method which quickly sets standard attributed
|
92
|
+
on the newly created object, such as the file, line, source and docstring of the
|
93
|
+
object. This method will be seen in the next example.
|
94
|
+
|
95
|
+
### Handling an Inner Block
|
96
|
+
|
97
|
+
By default, the parser gives the processor class a list of all the top level
|
98
|
+
statements and the processor parses only those top level statements. If an inner
|
99
|
+
block of a module, class, method declaration or even a block passed to a method call
|
100
|
+
needs to be handled, the {YARD::Handlers::Base#parse_block parse_block} method must be called on the list of statements
|
101
|
+
to parse. This will send the list to the processor to continue processing on that
|
102
|
+
statement list. The source tree can be selectively parsed in this manner by parsing
|
103
|
+
only the inner blocks that are relevant to documentation.
|
104
|
+
|
105
|
+
For example, the module handler parses the inner body of a module by performing
|
106
|
+
the following commands:
|
107
|
+
|
108
|
+
class YARD::Handlers::Ruby::ModuleHandler < YARD::Handlers::Ruby::Base
|
109
|
+
handles :module
|
110
|
+
|
111
|
+
def process
|
112
|
+
modname = statement[0].source
|
113
|
+
mod = register ModuleObject.new(namespace, modname)
|
114
|
+
parse_block(statement[1], :namespace => mod)
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
In this case `statement[1]` refers to a list of extra statements, the block we
|
119
|
+
wish to parse. Note here that when parsing objects like modules and classes,
|
120
|
+
we set the namespace for the duration of the block parsing by setting options
|
121
|
+
on the `parse_block` method.
|
122
|
+
|
123
|
+
### API Differences for Legacy Handler
|
124
|
+
|
125
|
+
Because the legacy handler uses the legacy parser and therefore a different kind
|
126
|
+
of AST, there are subtle differences in the handler API. Most importantly, the
|
127
|
+
`handles` method usually deals with either lexical tokens or source code as a string
|
128
|
+
or RegExp object. The statement object, similarly, is made up of lexical tokens instead
|
129
|
+
of semantically parsed nodes (this is described in the {file:docs/Parser.md parser document}).
|
130
|
+
|
131
|
+
The module example above can be rewritten as a legacy handler as follows:
|
132
|
+
|
133
|
+
class YARD::Handlers::Ruby::Legacy::ModuleHandler < YARD::Handlers::Ruby::Legacy::Base
|
134
|
+
handles TkMODULE
|
135
|
+
|
136
|
+
def process
|
137
|
+
modname = statement.tokens.to_s[/^module\s+(#{NAMESPACEMATCH})/, 1]
|
138
|
+
mod = register ModuleObject.new(namespace, modname)
|
139
|
+
parse_block(:namespace => mod)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
A few notes on the differences:
|
144
|
+
|
145
|
+
* We inherit from `Legacy::Base` instead of the standard Ruby Base handler class.
|
146
|
+
* We exchange node type `:module` for `TkMODULE`, which represents the
|
147
|
+
first token in the statement.
|
148
|
+
* We perform direct string manipulation to get the module name.
|
149
|
+
* `parse_block` does not take a list of statements. In the old parser API,
|
150
|
+
each statement has a `block` attribute which defines the list of
|
151
|
+
statements within that statement, if any. Therefore, `parse_block` will
|
152
|
+
always parse the `statement.block` if it exists.
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# @title Architecture Overview
|
2
|
+
|
3
|
+
# Architecture Overview
|
4
|
+
|
5
|
+
YARD is separated in three major components, each of which allows YARD to be
|
6
|
+
extended for a separate purpose. The split also emphasizes YARD's design choice
|
7
|
+
to explicitly separate data gathering from HTML document generation, something
|
8
|
+
that tools like RDoc do not do. These components are:
|
9
|
+
|
10
|
+
* [Code Parsing & Processing Component](#parsing)
|
11
|
+
* [Data Storage Component](#storage)
|
12
|
+
* [Post Processing & Templating System](#templates)
|
13
|
+
|
14
|
+
This separation is a major goal of the project, and means that YARD is not *just*
|
15
|
+
a tool to generate HTML output. The expectation is that any subset of YARD's
|
16
|
+
major components may be used, extended or modified independently. YARD may be
|
17
|
+
used just as a data gathering tool (to parse and audit code), just as as a data
|
18
|
+
source (a webserver containing raw unformatted data about code), or just as a
|
19
|
+
conventional HTML documentation generation tool (like RDoc).
|
20
|
+
|
21
|
+
The important classes and dependencies of these components are shown in the
|
22
|
+
following class diagram:
|
23
|
+
|
24
|
+

|
25
|
+
|
26
|
+
<a name="parsing"></a>
|
27
|
+
|
28
|
+
## Code Parsing & Processing Component
|
29
|
+
|
30
|
+
This component is made up of four sub-components, each of which have separate
|
31
|
+
tasks during the data gathering process (*note: the tag architecture is not*
|
32
|
+
*shown in the class diagram*). These sub-components are:
|
33
|
+
|
34
|
+
* {file:docs/Parser.md}
|
35
|
+
* {file:docs/Handlers.md}
|
36
|
+
* {file:docs/CodeObjects.md}
|
37
|
+
* {file:docs/Tags.md}
|
38
|
+
|
39
|
+
The parser component reads source files and converts it into a set of statements
|
40
|
+
which the handlers then process, creating code objects which in turn create tags
|
41
|
+
(meta-data) attached to the objects. These objects are all added to the {YARD::Registry},
|
42
|
+
the data store component.
|
43
|
+
|
44
|
+
<a name="storage"></a>
|
45
|
+
|
46
|
+
## Data Storage Component
|
47
|
+
|
48
|
+
This component is currently implemented as a simple Ruby marshalled flat namespace
|
49
|
+
of object. The implementation is found in the single class {YARD::Registry}, which
|
50
|
+
is the centralized repository for all data being parsed, stored and accessed. There
|
51
|
+
are future plans to improve this storage mechanism to be backend agnostic and allow
|
52
|
+
for more robust storage.
|
53
|
+
|
54
|
+
<a name="templates"></a>
|
55
|
+
|
56
|
+
## Post Processing & Templating System
|
57
|
+
|
58
|
+
This component handles processing of objects from the registry through a templating
|
59
|
+
engine that allows output to a variety of formats. Practically speaking, this is
|
60
|
+
where templates can be implemented to change the design, output or structure of
|
61
|
+
the data. See {file:docs/Templates.md Templates Architecture} for a complete overview.
|
@@ -0,0 +1,191 @@
|
|
1
|
+
# @title Parser Architecture
|
2
|
+
|
3
|
+
# Parser Architecture
|
4
|
+
|
5
|
+
The parser component of YARD is the first component in the data processing pipeline
|
6
|
+
that runs before any handling is done on the source. The parser is meant to translate
|
7
|
+
the source into a set of statements that can be understood by the {file:docs/Handlers.md Handlers}
|
8
|
+
that run immediately afterwards.
|
9
|
+
|
10
|
+
The important classes are described in the class diagram of the entire parser
|
11
|
+
system below:
|
12
|
+
|
13
|
+

|
14
|
+
|
15
|
+
(Note: the RubyToken classes are omitted from the diagram)
|
16
|
+
|
17
|
+
## SourceParser
|
18
|
+
|
19
|
+
The main class {YARD::Parser::SourceParser} acts as a factory class, instantiating
|
20
|
+
the correct parser class, an implementation of {YARD::Parser::Base}. The selected parser
|
21
|
+
is chosen based on either the file extension or by selecting it explicitly (as an argument
|
22
|
+
to parsing methods). YARD supports Ruby and C source files, but custom parsers can
|
23
|
+
be implemented and registered for various other languages by subclassing `Parser::Base`
|
24
|
+
and registering the parser with {YARD::Parser::SourceParser.register_parser_type}.
|
25
|
+
|
26
|
+
This factory class should always be used when parsing source files rather than
|
27
|
+
the individual parser classes since it initiates the pipeline that runs the
|
28
|
+
handlers on the parsed source. The parser used must also match the handlers,
|
29
|
+
and this is coordinated by the `SourceParser` class as well.
|
30
|
+
|
31
|
+
## Using the SourceParser Class
|
32
|
+
|
33
|
+
The `SourceParser` class API is optimized for parsing globs of files. As such,
|
34
|
+
the main method to use the class is the `parse` class method, which takes an
|
35
|
+
array of file globs or a single file glob.
|
36
|
+
|
37
|
+
YARD::Parser::SourceParser.parse('spec_*.rb')
|
38
|
+
YARD::Parser::SourceParser.parse(['spec_*.rb', '*_helper.rb'])
|
39
|
+
|
40
|
+
This is equivalent to the convenience method {YARD.parse}:
|
41
|
+
|
42
|
+
YARD.parse('lib/**/*.rb')
|
43
|
+
|
44
|
+
In some cases (ie. for testing), it may be more helpful to parse a string of input
|
45
|
+
directly. In such a case, the method {YARD::Parser::SourceParser.parse_string} should be
|
46
|
+
used:
|
47
|
+
|
48
|
+
YARD::Parser::SourceParser.parse_string("def method(a, b) end")
|
49
|
+
|
50
|
+
You can also provide the parser type explicitly as the second argument:
|
51
|
+
|
52
|
+
# Parses a string of C
|
53
|
+
YARD::Parser::SourceParser.parse_string("int main() { }", :c)
|
54
|
+
|
55
|
+
Note that these two methods are aliased as {YARD.parse} and {YARD.parse_string} for
|
56
|
+
convenience.
|
57
|
+
|
58
|
+
## Implementing and Registering a Custom Parser
|
59
|
+
|
60
|
+
To implement a custom parser, subclass {YARD::Parser::Base}. Documentation on which
|
61
|
+
abstract methods should be implemented are documented in that class. After the class
|
62
|
+
is implemented, it is registered with the {YARD::Parser::SourceParser} factory class
|
63
|
+
to be called when a file of the right extension needs to be parsed, or when a user
|
64
|
+
selects that parser type explicitly. To register your new parser class, call the
|
65
|
+
method {YARD::Parser::SourceParser.register_parser_type}:
|
66
|
+
|
67
|
+
SourceParser.register_parser_type(:my_parser, MyParser, 'my_parser_ext')
|
68
|
+
|
69
|
+
The last argument can be a single extension, a list of extensions (Array), a single Regexp, or a
|
70
|
+
list of Regexps. Do not include the '.' in the extension.
|
71
|
+
|
72
|
+
|
73
|
+
## The Two Ruby Parser Types
|
74
|
+
|
75
|
+
When parsing Ruby, the SourceParser can either instantiate the new {YARD::Parser::Ruby::RubyParser}
|
76
|
+
class or the {YARD::Parser::Ruby::Legacy::StatementList} class. The first of the
|
77
|
+
two, although faster, more robust and more efficient, is only available for
|
78
|
+
Ruby 1.9. The legacy parser parser is available in both 1.8.x and 1.9, if
|
79
|
+
compatibility is required. The choice of parser will affect which handlers
|
80
|
+
ultimately get used, since new handlers can only use the new parser and the
|
81
|
+
same requirement applies to the legacy parser & handlers.
|
82
|
+
|
83
|
+
## Switching to Legacy Parser
|
84
|
+
|
85
|
+
By default, running YARD under Ruby 1.9 will automatically select the new parser
|
86
|
+
and new handlers by extension. Although YARD supports both handler styles, plugins
|
87
|
+
may choose to only implement one of the two (though this is not recommended). If
|
88
|
+
only the legacy handlers are implemented, the `SourceParser` class should force
|
89
|
+
the use of the legacy parser by setting the `parser_type` attribute as such:
|
90
|
+
|
91
|
+
YARD::Parser::SourceParser.parser_type = :ruby18
|
92
|
+
|
93
|
+
The default value is `:ruby`. Note that this cannot be forced the other way around,
|
94
|
+
a parser type of `:ruby` cannot be set under Ruby 1.8.x as the new parser is not
|
95
|
+
supported under 1.8.
|
96
|
+
|
97
|
+
## RubyParser (the New Parser)
|
98
|
+
|
99
|
+
The new Ruby parser uses the Ripper library that is packaged as part of stdlib
|
100
|
+
in Ruby 1.9. Because of this, it can generate an AST from a string of Ruby input
|
101
|
+
that is similar to the style of other sexp libraries (such as ParseTree). Each
|
102
|
+
node generated in the tree is of the base type {YARD::Parser::Ruby::AstNode},
|
103
|
+
which has some subclasses for common node types.
|
104
|
+
|
105
|
+
### AstNode Basics
|
106
|
+
|
107
|
+
The `AstNode` class behaves like a standard Array class in which all of its data
|
108
|
+
make up the list of elements in the array. Unlike other sexp style libraries, however,
|
109
|
+
the node type is not the first element of the list. Instead, the node type is defined
|
110
|
+
by the `#type` method. The following examples show some of the basic uses of `AstNode`:
|
111
|
+
|
112
|
+
# The sexp defines the statement `hello if 1`
|
113
|
+
node = s(:if_mod, s(:int, "1"), s(:var_ref, s(:ident, "hello")))
|
114
|
+
node.type #=> :if_mod
|
115
|
+
node[0] #=> s(:int, "1")
|
116
|
+
node[0][0] #=> "1"
|
117
|
+
|
118
|
+
(Note the `s()` syntax is shorthand for `AstNode.new(...)`. `s()` with no type
|
119
|
+
is shorthand for a node of type `:list`)
|
120
|
+
|
121
|
+
As shown, not all of the elements are AstNodes in themselves, some are String
|
122
|
+
objects containing values. A list of only the AstNodes within a node can be
|
123
|
+
accessed via the {YARD::Parser::Ruby::AstNode#children #children} method. Using
|
124
|
+
the sexp declared above, we can do:
|
125
|
+
|
126
|
+
node.children #=> [s(:int, "1"), s(:var_ref, s(:ident, "hello"))]
|
127
|
+
|
128
|
+
### AstNode#source and #line
|
129
|
+
|
130
|
+
Every node defines the `#source` method which returns the source code that the
|
131
|
+
node represents. One of the most common things to do with a node is to grab its
|
132
|
+
source. The following example shows how this can be done:
|
133
|
+
|
134
|
+
source = "if 1 == 1 then\n raise Exception\n end"
|
135
|
+
ast = YARD::Parser::Ruby::RubyParser.parse(source).root
|
136
|
+
ast[0].condition.source #=> "1 == 1"
|
137
|
+
ast[0].then_block.source #=> "raise Exception"
|
138
|
+
|
139
|
+
Note that this only works on source parsed from the RubyParser, not sexps
|
140
|
+
declared using the `s()` syntax. This is because no source code is generated
|
141
|
+
or stored by nodes. Instead, only the character ranges are stored, which are
|
142
|
+
then looked up in the original full source string object. For example:
|
143
|
+
|
144
|
+
# Following the code snippet above
|
145
|
+
ast[0].then_block.source_range #=> 17..31
|
146
|
+
|
147
|
+
We can also get the line and line ranges in a similar fashion:
|
148
|
+
|
149
|
+
ast[0].type #=> :if
|
150
|
+
ast[0].line #=> 1
|
151
|
+
ast[0].line_range #=> 1..3 (note the newlines in the source)
|
152
|
+
|
153
|
+
### AstNode#jump
|
154
|
+
|
155
|
+
Often the AST will be such that the node we care about might be buried arbitrarily
|
156
|
+
deep in a node's hierarchy. The {YARD::Parser::Ruby::AstNode#jump} method exists
|
157
|
+
to quickly get at a node of a specific type in such a situation:
|
158
|
+
|
159
|
+
# Get the first identifier in the statement
|
160
|
+
ast = s(s(:int, "1"), s(s(:var_ref, s(:ident, "hello"))))
|
161
|
+
ast.jump(:ident)[0] #=> "hello"
|
162
|
+
|
163
|
+
Multiple types can be searched for at once. If none are found, the original root
|
164
|
+
node is returned so that it may be chained.
|
165
|
+
|
166
|
+
## The Legacy Parser
|
167
|
+
|
168
|
+
The goal of the legacy parser is much the same as the new parser, but it is far
|
169
|
+
more simplistic. Instead of a full-blown AST, the legacy parser simply groups
|
170
|
+
together lists of "statements" called a {YARD::Parser::Ruby::Legacy::StatementList}.
|
171
|
+
These statement lists are made up of {YARD::Parser::Ruby::Legacy::Statement} objects.
|
172
|
+
A statement is any method call condition, loop, or declaration. Each statement
|
173
|
+
may or may not have a block. In the case of a condition or loop, the block is
|
174
|
+
the inner list of statements; in the case of a method call, the block is a do
|
175
|
+
block (if provided). The statements themselves are made up of tokens, so instead
|
176
|
+
of being semantic in nature like the new parser, statements are tied directly
|
177
|
+
to the lexical tokens that make them up. To convert a statement into source, you
|
178
|
+
simply join all the tokens together (this is done through the use of `#to_s`).
|
179
|
+
|
180
|
+
Note that because there is little semantic parsing, the legacy parser is less
|
181
|
+
able to deal with certain Ruby syntaxes. Specifically, the `:if_mod` syntax
|
182
|
+
seen above ("hello if 1") would be considered two statements with the new parser,
|
183
|
+
but using the legacy parser it is only one statement:
|
184
|
+
|
185
|
+
stmts = ARD::Parser::Ruby::Legacy::StatementList.new("hello if 1")
|
186
|
+
stmts[0].block #=> nil
|
187
|
+
stmts[0].tokens.to_s #=> "hello if 1"
|
188
|
+
|
189
|
+
In addition, this means that most handling still needs to be done via string
|
190
|
+
manipulation and regular expression matching, making it considerably more
|
191
|
+
difficult to use in edge case scenarios.
|
@@ -0,0 +1,586 @@
|
|
1
|
+
# @title Tags Overview
|
2
|
+
|
3
|
+
# Tags Overview
|
4
|
+
|
5
|
+
Tags represent the metadata that can be added to documentation through the `@tag`
|
6
|
+
style syntax:
|
7
|
+
|
8
|
+
# @tagname some data
|
9
|
+
class Foo
|
10
|
+
end
|
11
|
+
|
12
|
+
The above example adds metadata under the name `tagname` to the Foo class object.
|
13
|
+
|
14
|
+
Tags are the best way to add arbitrary metadata when documenting an object in a
|
15
|
+
way to access it later without having to parse the entire comment string. The
|
16
|
+
rest of the document will describe the tag syntax, how to access the tag
|
17
|
+
metadata and how to extend YARD to support custom tags or override existing tags.
|
18
|
+
|
19
|
+
## Tag Syntax
|
20
|
+
|
21
|
+
Tags begin with "@tagname" at the start of a comment line. Tags can span multiple
|
22
|
+
lines if the subsequent lines are indented by more than one space. The following
|
23
|
+
syntax is valid:
|
24
|
+
|
25
|
+
# @tagname This is
|
26
|
+
# tag data
|
27
|
+
# but this is not
|
28
|
+
|
29
|
+
In the above example, "@tagname" will have the text *"This is tag data"*.
|
30
|
+
|
31
|
+
If a tag's data begins with `(see NAME)` it is considered a "reference tag".
|
32
|
+
The syntax and semantics of a reference tag are discussed in the section below
|
33
|
+
titled "[Reference Tags](#reftags)"
|
34
|
+
|
35
|
+
Although custom tags can be parsed in any way, the built-in tags follow a few
|
36
|
+
common syntax structures by convention in order to simplify the syntax. The
|
37
|
+
following syntaxes are available:
|
38
|
+
|
39
|
+
### Freeform Data
|
40
|
+
|
41
|
+
This syntax has no special syntax, it is simply a tagname followed by any
|
42
|
+
data.
|
43
|
+
|
44
|
+
@tagname data here
|
45
|
+
|
46
|
+
### Freeform Data With Title
|
47
|
+
|
48
|
+
Occasionally a freeform tag may reserve the first line for a title (or some
|
49
|
+
other associative identifier) and treat only the subsequent indented lines as
|
50
|
+
the tag data. Two examples are the `@example` and `@overload` tags. In the case
|
51
|
+
of `@example` the first line is a title, and in the case of `@overload` the
|
52
|
+
first line is the method signature for the overload. Here is an example of both:
|
53
|
+
|
54
|
+
@example Reverse a string
|
55
|
+
"hello world".reverse
|
56
|
+
|
57
|
+
@overload request(method = :get, url = 'http://example.com')
|
58
|
+
Performs a request on +url+
|
59
|
+
@param [Symbol] method the request method
|
60
|
+
@param [String] url the URL to perform the request on
|
61
|
+
@return [String] the result body (no headers)
|
62
|
+
|
63
|
+
### Data With Optional Type Information
|
64
|
+
|
65
|
+
This syntax optionally contains type information to be associated with the
|
66
|
+
tag. Type information is specified as a freeform list of Ruby types, duck
|
67
|
+
types or literal values. The following is a valid tag with type information:
|
68
|
+
|
69
|
+
@return [String, #read] a string or object that responds to #read
|
70
|
+
|
71
|
+
### Data With Name and Optional Type Information
|
72
|
+
|
73
|
+
A special case of the above data with optional type information is the case
|
74
|
+
of tags like `@param`, where the data is further associated with a key. In
|
75
|
+
the case of `@param` the key is an argument name in the method. The following
|
76
|
+
shows how this can be used:
|
77
|
+
|
78
|
+
@param [String] url the URL to perform the request on
|
79
|
+
|
80
|
+
Note that "url" in the above example is the key name. The syntax is of the form:
|
81
|
+
|
82
|
+
@tagname [types] <name> <description>
|
83
|
+
|
84
|
+
As mentioned, types are optional, so the following is also valid:
|
85
|
+
|
86
|
+
@param url the URL to perform the request on
|
87
|
+
|
88
|
+
|
89
|
+
<a name="taglist"></a>
|
90
|
+
|
91
|
+
## List of Available Tags
|
92
|
+
|
93
|
+
YARD supplies the following built-in tags:
|
94
|
+
|
95
|
+
* `@abstract`: Marks a class/module/method as abstract with optional
|
96
|
+
implementor information.
|
97
|
+
|
98
|
+
@abstract Subclass and override {#run} to implement a custom Threadable class.
|
99
|
+
|
100
|
+
* `@api`: Declares the API that the object belongs to. Does not display in
|
101
|
+
output, but useful for performing queries (`yardoc --query`). Any text is
|
102
|
+
allowable in this tag, and there are no predefined values(*).
|
103
|
+
|
104
|
+
@api freeform text
|
105
|
+
|
106
|
+
(*) Note that the special name `@api private` does display a notice in
|
107
|
+
documentation if it is listed, letting users know that the method is not
|
108
|
+
to be used.
|
109
|
+
|
110
|
+
* `@attr`: Declares an attribute from the docstring of a class. Meant to be
|
111
|
+
used on Struct classes only (classes that inherit Struct).
|
112
|
+
|
113
|
+
@attr [Types] attribute_name a full description of the attribute
|
114
|
+
|
115
|
+
* `@attr_reader`: Declares a readonly attribute from the docstring of a class.
|
116
|
+
Meant to be used on Struct classes only (classes that inherit Struct). See `@attr`.
|
117
|
+
|
118
|
+
@attr_reader [Types] name description of a readonly attribute
|
119
|
+
|
120
|
+
* `@attr_writer`: Declares a writeonly attribute from the docstring of class.
|
121
|
+
Meant to be used on Struct classes only (classes that inherit Struct). See `@attr`.
|
122
|
+
|
123
|
+
@attr_writer [Types] name description of writeonly attribute
|
124
|
+
|
125
|
+
* `@attribute`: Recognizes a DSL class method as an attribute with the given
|
126
|
+
name. Also accepts the r, w, or rw flag to signify that the attribute is
|
127
|
+
readonly, writeonly, or readwrite (default). Only used with DSL methods.
|
128
|
+
|
129
|
+
@attribute [rw|r|w] NAME
|
130
|
+
|
131
|
+
* `@author`: List the author(s) of a class/method
|
132
|
+
|
133
|
+
@author Full Name
|
134
|
+
|
135
|
+
* `@deprecated`: Marks a method/class as deprecated with an optional
|
136
|
+
reason.
|
137
|
+
|
138
|
+
@deprecated Describe the reason or provide alt. references here
|
139
|
+
|
140
|
+
* `@example`: Show an example snippet of code for an object. The
|
141
|
+
first line is an optional title.
|
142
|
+
|
143
|
+
@example Reverse a string
|
144
|
+
"mystring".reverse #=> "gnirtsym"
|
145
|
+
|
146
|
+
* `@macro`: Registers or expands a new macro. See the [Macros](#macros)
|
147
|
+
section for more details. Note that the name parameter is never optional.
|
148
|
+
|
149
|
+
@macro [new|attached] macro_name
|
150
|
+
The macro contents to expand
|
151
|
+
|
152
|
+
* `@method`: Recognizes a DSL class method as a method with the given name
|
153
|
+
and optional signature. Only used with DSL methods.
|
154
|
+
|
155
|
+
@method method_signature(opts = {}, &block)
|
156
|
+
|
157
|
+
* `@note`: Creates an emphasized note for the users to read about the
|
158
|
+
object.
|
159
|
+
|
160
|
+
@note This method should only be used in outer space.
|
161
|
+
|
162
|
+
* `@option`: Describe an options hash in a method. The tag takes the
|
163
|
+
name of the options parameter first, followed by optional types,
|
164
|
+
the option key name, an optional default value for the key and a
|
165
|
+
description of the option.
|
166
|
+
|
167
|
+
# @param [Hash] opts the options to create a message with.
|
168
|
+
# @option opts [String] :subject The subject
|
169
|
+
# @option opts [String] :from ('nobody') From address
|
170
|
+
# @option opts [String] :to Recipient email
|
171
|
+
# @option opts [String] :body ('') The email's body
|
172
|
+
def send_email(opts = {})
|
173
|
+
end
|
174
|
+
|
175
|
+
* `@overload`: Describe that your method can be used in various
|
176
|
+
contexts with various parameters or return types. The first
|
177
|
+
line should declare the new method signature, and the following
|
178
|
+
indented tag data will be a new documentation string with its
|
179
|
+
own tags adding metadata for such an overload.
|
180
|
+
|
181
|
+
# @overload set(key, value)
|
182
|
+
# Sets a value on key
|
183
|
+
# @param [Symbol] key describe key param
|
184
|
+
# @param [Object] value describe value param
|
185
|
+
# @overload set(value)
|
186
|
+
# Sets a value on the default key `:foo`
|
187
|
+
# @param [Object] value describe value param
|
188
|
+
def set(*args)
|
189
|
+
end
|
190
|
+
|
191
|
+
* `@param`: Defines method parameters
|
192
|
+
|
193
|
+
@param [optional, types, ...] argname description
|
194
|
+
|
195
|
+
* `@private`: Defines an object as private. This exists for classes,
|
196
|
+
modules and constants that do not obey Ruby's visibility rules. For
|
197
|
+
instance, an inner class might be considered "private", though Ruby
|
198
|
+
would make no such distinction. By declaring the @private tag, the
|
199
|
+
class can be hidden from documentation by using the `--no-private`
|
200
|
+
command-line switch to yardoc (see {file:README.md}).
|
201
|
+
|
202
|
+
@private
|
203
|
+
|
204
|
+
* `@raise`: Describes an Exception that a method may throw
|
205
|
+
|
206
|
+
@raise [ExceptionClass] description
|
207
|
+
|
208
|
+
* `@return`: Describes return value of method
|
209
|
+
|
210
|
+
@return [optional, types, ...] description
|
211
|
+
|
212
|
+
* `@scope`: Sets the scope of a DSL method. Only applicable to DSL method
|
213
|
+
calls. Acceptable values are 'class' or 'instance'
|
214
|
+
|
215
|
+
@scope class|instance
|
216
|
+
|
217
|
+
* `@see`: "See Also" references for an object. Accepts URLs or
|
218
|
+
other code objects with an optional description at the end.
|
219
|
+
|
220
|
+
@see http://example.com Description of URL
|
221
|
+
@see SomeOtherClass#method
|
222
|
+
|
223
|
+
* `@since`: Lists the version the feature/object was first added
|
224
|
+
|
225
|
+
@since 1.2.4
|
226
|
+
|
227
|
+
* `@todo`: Marks a TODO note in the object being documented
|
228
|
+
|
229
|
+
@todo Add support for Jabberwocky service
|
230
|
+
There is an open source Jabberwocky library available
|
231
|
+
at http://somesite.com that can be integrated easily
|
232
|
+
into the project.
|
233
|
+
|
234
|
+
* `@version`: Lists the version of a class, module or method
|
235
|
+
|
236
|
+
@version 1.0
|
237
|
+
|
238
|
+
* `@visibility`: Sets the visibility of a DSL method. Only applicable to
|
239
|
+
DSL method calls. Acceptable values are public, protected, or private.
|
240
|
+
|
241
|
+
@visibility public|protected|private
|
242
|
+
|
243
|
+
* `@yield`: Describes the block. Use types to list the parameter
|
244
|
+
names the block yields.
|
245
|
+
|
246
|
+
# for block {|a, b, c| ... }
|
247
|
+
@yield [a, b, c] Description of block
|
248
|
+
|
249
|
+
* `@yieldparam`: Defines parameters yielded by a block
|
250
|
+
|
251
|
+
@yieldparam [optional, types, ...] argname description
|
252
|
+
|
253
|
+
* `@yieldreturn`: Defines return type of a block
|
254
|
+
|
255
|
+
@yieldreturn [optional, types, ...] description
|
256
|
+
|
257
|
+
|
258
|
+
<a name="reftags"></a>
|
259
|
+
|
260
|
+
## Reference Tags
|
261
|
+
|
262
|
+
Although attempt is made in YARD to leave as many of the syntax details as
|
263
|
+
possible to the factory provider, there is a special tag syntax for referencing
|
264
|
+
tags created in other objects so that they can be reused again. This is common
|
265
|
+
when an object describes a return type or parameters that are passed through to
|
266
|
+
other methods. In such a case, it is more manageable to use the reference tag
|
267
|
+
syntax. Consider the following example:
|
268
|
+
|
269
|
+
class User
|
270
|
+
# @param [String] username the nam of the user to add
|
271
|
+
# @param [Number] uid the user ID
|
272
|
+
# @param [Number] gid the group ID
|
273
|
+
def initialize(username, uid, gid)
|
274
|
+
end
|
275
|
+
end
|
276
|
+
|
277
|
+
module UserHelper
|
278
|
+
# @param (see User#initialize)
|
279
|
+
def add_user(username, uid, gid)
|
280
|
+
User.new(username, uid, gid)
|
281
|
+
end
|
282
|
+
|
283
|
+
# @param username (see User#initialize)
|
284
|
+
def add_root_user(username)
|
285
|
+
User.new(username, 0, 0)
|
286
|
+
end
|
287
|
+
end
|
288
|
+
|
289
|
+
Because the UserHelper module methods delegate directly to `User.new`, copying
|
290
|
+
the documentation details would be unmaintainable. In this case, the (see METHODNAME)
|
291
|
+
syntax is used to reference the tags from the User constructor to the helper methods.
|
292
|
+
For the first method, all `@param` tags are referenced in one shot, but the second
|
293
|
+
method only references one of the tags by adding `username` before the reference.
|
294
|
+
|
295
|
+
Reference tags are represented by the {YARD::Tags::RefTag} class and are created
|
296
|
+
directly during parsing by {YARD::Docstring}.
|
297
|
+
|
298
|
+
<a name="macros"></a>
|
299
|
+
|
300
|
+
## Macros
|
301
|
+
|
302
|
+
Macros enable the documenter to write repetitive documentation once and then
|
303
|
+
re-apply it to other objects. Macros are defined on docstrings using the
|
304
|
+
`@macro` tag. The same `@macro` tag is used to expand them. The following
|
305
|
+
is an example of a simple macro declaration and expansion:
|
306
|
+
|
307
|
+
# @macro [new] string_attr
|
308
|
+
# @return [String] the attribute +$1+ as a String
|
309
|
+
attr_accessor :foo
|
310
|
+
|
311
|
+
# @macro string_attr
|
312
|
+
attr_accessor :bar
|
313
|
+
|
314
|
+
In the above example, both attributes `foo` and `bar` will get the docstring
|
315
|
+
that includes a return tag "the attribute as a String". It would be equivalent
|
316
|
+
to writing the following:
|
317
|
+
|
318
|
+
# @return [String] the attribute +foo+ as a String
|
319
|
+
attr_accessor :foo
|
320
|
+
|
321
|
+
# @return [String] the attribute +bar+ as a String
|
322
|
+
attr_accessor :bar
|
323
|
+
|
324
|
+
### Creating a Macro
|
325
|
+
|
326
|
+
If the macro does not already exist, it will be created if:
|
327
|
+
|
328
|
+
1. there are interpolation variables (`$1`, `$2`, `${3-5}`, etc.) in the
|
329
|
+
docstring, or,
|
330
|
+
2. the macro is specified with the `[new]` or `[attached]` flag.
|
331
|
+
|
332
|
+
For instance, creating a new macro might look like (see the section on
|
333
|
+
interpolation below for a description of the `$2` syntax):
|
334
|
+
|
335
|
+
# @macro the_macro_name
|
336
|
+
# @return [$2] the thing to return
|
337
|
+
typed_attribute :foo, String
|
338
|
+
|
339
|
+
Or:
|
340
|
+
|
341
|
+
# @macro [new] the_macro_name
|
342
|
+
# Returns a string!
|
343
|
+
def foo; end
|
344
|
+
|
345
|
+
You can also "attach" a macro to a method if it is in the class scope. In
|
346
|
+
this case, you do not need to also provide the 'new' flag, using 'attach'
|
347
|
+
is sufficient:
|
348
|
+
|
349
|
+
# @macro [attach] the_macro_name
|
350
|
+
# @return [String] the string value
|
351
|
+
def self.foo; end
|
352
|
+
|
353
|
+
Any time 'foo' is called in the class scope of an inheriting class, the macro
|
354
|
+
will automatically expand on that method call (potentially creating a new
|
355
|
+
method object). Attaching macros is discussed below.
|
356
|
+
|
357
|
+
Note that the name is never optional. Even if the macro is never re-used,
|
358
|
+
it must be named.
|
359
|
+
|
360
|
+
### Indenting the Macro Data
|
361
|
+
|
362
|
+
If a macro tag has an indented body of macro data (shown below), it will be
|
363
|
+
the only portion of the docstring saved for re-use.
|
364
|
+
|
365
|
+
# @macro [new] macro_name
|
366
|
+
# The macro data is here.
|
367
|
+
# This data is only used for the current object
|
368
|
+
def method; end
|
369
|
+
|
370
|
+
In the above case, "The macro data is here." is the only portion that will be
|
371
|
+
re-used if the macro is called again on another object. However, for the case
|
372
|
+
of the above method, both the macro data and the local docstring will be
|
373
|
+
applied to the method, creating the docstring:
|
374
|
+
|
375
|
+
# The macro data is here.
|
376
|
+
# This data is only used for the current object.
|
377
|
+
def method; end
|
378
|
+
|
379
|
+
You can therefore keep portions of docstrings local to objects even when
|
380
|
+
creating a macro, by indenting the portion of the data that should be re-
|
381
|
+
expanded, and listing the local docstring data above or below.
|
382
|
+
|
383
|
+
If there is no indented macro data, the entire docstring is saved as the
|
384
|
+
macro data. For instance,
|
385
|
+
|
386
|
+
# @macro [new] macro_name
|
387
|
+
# The macro data is here.
|
388
|
+
# This data is also used for all macros.
|
389
|
+
def method; end
|
390
|
+
|
391
|
+
In the above case, the macro 'macro_name' will always show both lines of text
|
392
|
+
when expanded on other objects.
|
393
|
+
|
394
|
+
### Attaching a Macro to a DSL (Class) Method
|
395
|
+
|
396
|
+
Macros can be created on class level methods (or class level method calls) in
|
397
|
+
order to implicitly expand a macro whenever that method is subsequently called
|
398
|
+
in a class, or any class that mixes in or inherits the method. These macros
|
399
|
+
are called "attached" and are declared with the `[attach]` flag. For instance,
|
400
|
+
a library that uses a class level method call `property` in its codebase can
|
401
|
+
document these declarations in any future call like so:
|
402
|
+
|
403
|
+
class Resource
|
404
|
+
# Defines a new property
|
405
|
+
# @param [String] name the property name
|
406
|
+
# @param [Class] type the property's type
|
407
|
+
# @macro [attach] property
|
408
|
+
# @return [$2] the $1 property
|
409
|
+
def self.property(name, type) end
|
410
|
+
end
|
411
|
+
|
412
|
+
class Post < Resource
|
413
|
+
property :title, String
|
414
|
+
property :view_count, Integer
|
415
|
+
end
|
416
|
+
|
417
|
+
If you cannot declare the macro on the actual method declaration, you can
|
418
|
+
arbitrarily attach the macro to any method call. Suppose we only had the
|
419
|
+
Post class in our codebase, we could add the macro to the first usage of
|
420
|
+
the `property` call:
|
421
|
+
|
422
|
+
class Post < Resource
|
423
|
+
# @macro [attach] property
|
424
|
+
# @return [$2] the $1 property
|
425
|
+
property :title, String
|
426
|
+
property :view_count, Integer
|
427
|
+
end
|
428
|
+
|
429
|
+
### Macro Variable Interpolation Syntax
|
430
|
+
|
431
|
+
The interpolation syntax is similar to Ruby's regular expression variable syntax.
|
432
|
+
It uses $1, $2, $3, ..., referring to the Nth argument in the method call. Using
|
433
|
+
the above property example, $1 would be 'title', and $2 would be 'String'.
|
434
|
+
$0 is a special variable that refers to the method call itself, in this case
|
435
|
+
'property'. Finally, there is a $& variable which refers to the full line,
|
436
|
+
or 'property :title, String'.
|
437
|
+
|
438
|
+
#### Ranges
|
439
|
+
|
440
|
+
Ranges are also acceptable with the syntax `${N-M}`. Negative values on either
|
441
|
+
N or M are valid, and refer to indexes from the end of the list. Consider
|
442
|
+
a DSL method that creates a method using the first argument with argument
|
443
|
+
names following, ending with the return type of the method. This could be
|
444
|
+
documented as:
|
445
|
+
|
446
|
+
# @macro dsl_method
|
447
|
+
# @method $1(${2--2})
|
448
|
+
# @return [${-1}] the return value of $0
|
449
|
+
create_method_with_args :foo, :a, :b, :c, String
|
450
|
+
|
451
|
+
As described, the method is using the signature `foo(a, b, c)` and the return
|
452
|
+
type from the last argument, `String`. When using ranges, tokens are joined
|
453
|
+
with commas. Note that this includes using $0:
|
454
|
+
|
455
|
+
$0-1 # => Interpolates to "create_method_with_args, foo"
|
456
|
+
|
457
|
+
If you want to separate them with spaces, use `$1 $2 $3 $4 ...`. Note that
|
458
|
+
if the token cannot be expanded, it will return the empty string (not an error),
|
459
|
+
so it would be safe to list `$1 $2 ... $10`, for example.
|
460
|
+
|
461
|
+
#### Escaping Interpolation
|
462
|
+
|
463
|
+
Interpolation can be escaped by prefixing the `$` with `\`, like so:
|
464
|
+
|
465
|
+
# @macro foo
|
466
|
+
# I have \$2.00 USD.
|
467
|
+
|
468
|
+
## Programmatic API
|
469
|
+
|
470
|
+
### Accessing Tag Information
|
471
|
+
|
472
|
+
Tag metadata is added when a {YARD::Docstring} is added to a {file:docs/CodeObjects.md code object}
|
473
|
+
using the {YARD::CodeObjects::Base#docstring=} attribute. In addition to adding
|
474
|
+
conventional comments, tags are parsed and associated with the object. The easiest
|
475
|
+
way to access tags on an object is to use the {YARD::CodeObjects::Base#tag} and `#tags`
|
476
|
+
methods, for example:
|
477
|
+
|
478
|
+
# Using the Foo class object from above
|
479
|
+
obj.tags(:tagname).first.text #=> "some data"
|
480
|
+
|
481
|
+
Because multiple tags can be stored with the same name, they are stored as a list
|
482
|
+
of tags. The `#tag` method is an alias for the first item in the list of tags.
|
483
|
+
Also note that the `#tag`, `#tags` and `#has_tag?` methods are all convenience
|
484
|
+
methods that delegate to the {YARD::Docstring} object described above.
|
485
|
+
|
486
|
+
### Adding Custom Tags
|
487
|
+
|
488
|
+
The `@tagname` tag used in the above examples is clearly not part of the tags
|
489
|
+
that come with YARD. If such a tag would actually be part of documentation under
|
490
|
+
a default install, YARD would raise a warning that the tag does not exist. It is,
|
491
|
+
however, trivial to add this tag to be recognized by YARD.
|
492
|
+
|
493
|
+
All tags in YARD are added to the {YARD::Tags::Library tag library} which makes
|
494
|
+
use of a tag factory class to parse the data inside the tags. To simply add a
|
495
|
+
tag that stores simple text like our `@tagname` tag above, use:
|
496
|
+
|
497
|
+
YARD::Tags::Library.define_tag("A Sample Tag", :tagname)
|
498
|
+
|
499
|
+
This will now allow YARD to add the metadata from `@tagname` to the docstring.
|
500
|
+
|
501
|
+
## Tag Factory Architecture
|
502
|
+
|
503
|
+
Recognizing a tag is one part of the process. Parsing the tag contents is the
|
504
|
+
second step. YARD has a tag architecture that allows developers to add or completely
|
505
|
+
change the way tags contents can be parsed.
|
506
|
+
|
507
|
+
The separation of registration and tag creation can be seen in the following
|
508
|
+
class diagram:
|
509
|
+
|
510
|
+

|
511
|
+
|
512
|
+
### DefaultFactory
|
513
|
+
|
514
|
+
By default, YARD has a few standard syntaxes that can be parsed for tags. These
|
515
|
+
are all implemented by the {YARD::Tags::DefaultFactory} class. These syntaxes
|
516
|
+
are:
|
517
|
+
|
518
|
+
* Standard text: no parsing is done, but text is stripped of newlines and
|
519
|
+
multiple spaces.
|
520
|
+
|
521
|
+
* Raw text: does no parsing at all, no stripping of newlines or spaces. This
|
522
|
+
is best used for code snippets.
|
523
|
+
|
524
|
+
* Raw text with title: does no parsing on the text but extracts the first line
|
525
|
+
of the metadata as the "title", useful for tags such as `@example`:
|
526
|
+
|
527
|
+
# @example Inspect an element
|
528
|
+
# myobj.inspect #=> #<Object:0x123525>
|
529
|
+
|
530
|
+
* Text with types: parses a list of types at the beginning of the text. Types
|
531
|
+
are optional. The standard syntax is in the form `[type1, type2, ...]`,
|
532
|
+
for example:
|
533
|
+
|
534
|
+
# @return [String, Symbol] a description here
|
535
|
+
# @return description here with no types
|
536
|
+
|
537
|
+
* Text with types and a name: parses a list of types at the beginning of text
|
538
|
+
followed by a name and extra descriptive text. For example:
|
539
|
+
|
540
|
+
# @param [String] str the string to reverse
|
541
|
+
def reverse(str) '...' end
|
542
|
+
|
543
|
+
As mentioned above, this syntax is implemented by the `DefaultFactory` which can
|
544
|
+
be swapped out for any factory. In some cases, a developer may want to change
|
545
|
+
the type declaration syntax to be in the form:
|
546
|
+
|
547
|
+
# @tagname name <Types, here> description
|
548
|
+
|
549
|
+
This can be done by simply implementing a new factory that parses the data in
|
550
|
+
this form.
|
551
|
+
|
552
|
+
### Implementing a Factory
|
553
|
+
|
554
|
+
Factories should implement the method `parse_tag` as well as any `parse_tag_SUFFIX`
|
555
|
+
method where SUFFIX refers to the suffix added when declaring the tag. For example,
|
556
|
+
a tag can also be declared as follows:
|
557
|
+
|
558
|
+
YARD::Tags::Library.define_tag "Parameter", :param, :with_types
|
559
|
+
|
560
|
+
In such a case, the factory will be called with method `parse_tag_with_types`. In
|
561
|
+
all cases, the method should return a new {YARD::Tags::Tag} object. Generally,
|
562
|
+
the `parse_tag` methods take 2 or 3 parameters. A simple tag can be implemented
|
563
|
+
as:
|
564
|
+
|
565
|
+
def parse_tag(tag_name, text)
|
566
|
+
Tag.new(tag_name, text)
|
567
|
+
end
|
568
|
+
|
569
|
+
The text parameter contains pre-parsed text with extra spaces and newlines removed.
|
570
|
+
If required, the method could also be declared with a third parameter containing
|
571
|
+
unmodified raw text:
|
572
|
+
|
573
|
+
def parse_tag_with_raw_text(tag_name, text, raw_text)
|
574
|
+
Tag.new(tag_name, raw_text)
|
575
|
+
end
|
576
|
+
|
577
|
+
Note that this method would be invoked for a tag declared with the `:with_raw_text`
|
578
|
+
suffix.
|
579
|
+
|
580
|
+
### Changing the Factory
|
581
|
+
|
582
|
+
To change the factory, set the {YARD::Tags::Library.default_factory} attribute:
|
583
|
+
|
584
|
+
YARD::Tags::Library.default_factory = MyFactory
|
585
|
+
|
586
|
+
This must be done before any parsing is done, or the factory will not be used.
|