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,517 @@
|
|
1
|
+
require 'stringio'
|
2
|
+
require 'ostruct'
|
3
|
+
|
4
|
+
begin require 'continuation'; rescue LoadError; end
|
5
|
+
|
6
|
+
module YARD
|
7
|
+
module Parser
|
8
|
+
# Raised when an object is recognized but cannot be documented. This
|
9
|
+
# generally occurs when the Ruby syntax used to declare an object is
|
10
|
+
# too dynamic in nature.
|
11
|
+
class UndocumentableError < Exception; end
|
12
|
+
|
13
|
+
# Raised when the parser sees a Ruby syntax error
|
14
|
+
class ParserSyntaxError < UndocumentableError; end
|
15
|
+
|
16
|
+
# A LoadOrderError occurs when a handler needs to modify a
|
17
|
+
# {CodeObjects::NamespaceObject} (usually by adding a child to it)
|
18
|
+
# that has not yet been resolved.
|
19
|
+
#
|
20
|
+
# @see Handers::Base#ensure_loaded!
|
21
|
+
class LoadOrderError < Exception
|
22
|
+
# @return [Continuation] the context representing the
|
23
|
+
# point at which the load order error occurred.
|
24
|
+
attr_accessor :context
|
25
|
+
|
26
|
+
# @param [Continuation] context see {#context}
|
27
|
+
def initialize(context)
|
28
|
+
@context = context
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
# Responsible for parsing a source file into the namespace. Parsing
|
33
|
+
# also invokes handlers to process the parsed statements and generate
|
34
|
+
# any code objects that may be recognized.
|
35
|
+
#
|
36
|
+
# == Custom Parsers
|
37
|
+
# SourceParser allows custom parsers to be registered and called when
|
38
|
+
# a certain filetype is recognized. To register a parser and hook it
|
39
|
+
# up to a set of file extensions, call {register_parser_type}
|
40
|
+
#
|
41
|
+
# @see register_parser_type
|
42
|
+
# @see Handlers::Base
|
43
|
+
# @see CodeObjects::Base
|
44
|
+
class SourceParser
|
45
|
+
SHEBANG_LINE = /\A\s*#!\S+/
|
46
|
+
ENCODING_LINE = /\A(?:\s*#*!.*\r?\n)?\s*(?:#+|\/\*+|\/\/+).*coding\s*[:=]{1,2}\s*([a-z\d_\-]+)/i
|
47
|
+
|
48
|
+
# Byte order marks for various encodings
|
49
|
+
# @since 0.7.0
|
50
|
+
ENCODING_BYTE_ORDER_MARKS = {
|
51
|
+
'utf-8' => "\xEF\xBB\xBF",
|
52
|
+
# Not yet supported
|
53
|
+
#'utf-16be' => "\xFE\xFF",
|
54
|
+
#'utf-16le' => "\xFF\xFE",
|
55
|
+
#'utf-32be' => "\x00\x00\xFF\xFE",
|
56
|
+
#'utf-32le' => "\xFF\xFE",
|
57
|
+
}
|
58
|
+
|
59
|
+
class << self
|
60
|
+
# @return [Symbol] the default parser type (defaults to :ruby)
|
61
|
+
attr_reader :parser_type
|
62
|
+
|
63
|
+
def parser_type=(value)
|
64
|
+
@parser_type = validated_parser_type(value)
|
65
|
+
end
|
66
|
+
|
67
|
+
# Parses a path or set of paths
|
68
|
+
#
|
69
|
+
# @param [String, Array<String>] paths a path, glob, or list of paths to
|
70
|
+
# parse
|
71
|
+
# @param [Array<String, Regexp>] excluded a list of excluded path matchers
|
72
|
+
# @param [Fixnum] level the logger level to use during parsing. See
|
73
|
+
# {YARD::Logger}
|
74
|
+
# @return [void]
|
75
|
+
def parse(paths = ["{lib,app}/**/*.rb", "ext/**/*.c"], excluded = [], level = log.level)
|
76
|
+
log.debug("Parsing #{paths.inspect} with `#{parser_type}` parser")
|
77
|
+
excluded = excluded.map do |path|
|
78
|
+
case path
|
79
|
+
when Regexp; path
|
80
|
+
else Regexp.new(path.to_s, Regexp::IGNORECASE)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
files = [paths].flatten.
|
84
|
+
map {|p| File.directory?(p) ? "#{p}/**/*.{rb,c}" : p }.
|
85
|
+
map {|p| p.include?("*") ? Dir[p] : p }.flatten.
|
86
|
+
reject {|p| !File.file?(p) || excluded.any? {|re| p =~ re } }
|
87
|
+
|
88
|
+
log.enter_level(level) do
|
89
|
+
parse_in_order(*files.uniq)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
# Parses a string +content+
|
94
|
+
#
|
95
|
+
# @param [String] content the block of code to parse
|
96
|
+
# @param [Symbol] ptype the parser type to use. See {parser_type}.
|
97
|
+
# @return the parser object that was used to parse +content+
|
98
|
+
def parse_string(content, ptype = parser_type)
|
99
|
+
new(ptype).parse(StringIO.new(content))
|
100
|
+
end
|
101
|
+
|
102
|
+
# Tokenizes but does not parse the block of code
|
103
|
+
#
|
104
|
+
# @param [String] content the block of code to tokenize
|
105
|
+
# @param [Symbol] ptype the parser type to use. See {parser_type}.
|
106
|
+
# @return [Array] a list of tokens
|
107
|
+
def tokenize(content, ptype = parser_type)
|
108
|
+
new(ptype).tokenize(content)
|
109
|
+
end
|
110
|
+
|
111
|
+
# Registers a new parser type.
|
112
|
+
#
|
113
|
+
# @example Registering a parser for "java" files
|
114
|
+
# SourceParser.register_parser_type :java, JavaParser, 'java'
|
115
|
+
# @param [Symbol] type a symbolic name for the parser type
|
116
|
+
# @param [Base] parser_klass a class that implements parsing and tokenization
|
117
|
+
# @param [Array<String>, String, Regexp] extensions a list of extensions or a
|
118
|
+
# regex to match against the file extension
|
119
|
+
# @return [void]
|
120
|
+
# @see Parser::Base
|
121
|
+
def register_parser_type(type, parser_klass, extensions = nil)
|
122
|
+
unless Base > parser_klass
|
123
|
+
raise ArgumentError, "expecting parser_klass to be a subclass of YARD::Parser::Base"
|
124
|
+
end
|
125
|
+
parser_type_extensions[type.to_sym] = extensions if extensions
|
126
|
+
parser_types[type.to_sym] = parser_klass
|
127
|
+
end
|
128
|
+
|
129
|
+
# @return [Hash{Symbol=>Object}] a list of registered parser types
|
130
|
+
# @private
|
131
|
+
# @since 0.5.6
|
132
|
+
attr_reader :parser_types
|
133
|
+
undef parser_types
|
134
|
+
def parser_types; @@parser_types ||= {} end
|
135
|
+
def parser_types=(value) @@parser_types = value end
|
136
|
+
|
137
|
+
# @return [Hash] a list of registered parser type extensions
|
138
|
+
# @private
|
139
|
+
# @since 0.5.6
|
140
|
+
attr_reader :parser_type_extensions
|
141
|
+
undef parser_type_extensions
|
142
|
+
def parser_type_extensions; @@parser_type_extensions ||= {} end
|
143
|
+
def parser_type_extensions=(value) @@parser_type_extensions = value end
|
144
|
+
|
145
|
+
# Finds a parser type that is registered for the extension. If no
|
146
|
+
# type is found, the default Ruby type is returned.
|
147
|
+
#
|
148
|
+
# @return [Symbol] the parser type to be used for the extension
|
149
|
+
# @since 0.5.6
|
150
|
+
def parser_type_for_extension(extension)
|
151
|
+
type = parser_type_extensions.find do |t, exts|
|
152
|
+
[exts].flatten.any? {|ext| ext === extension }
|
153
|
+
end
|
154
|
+
validated_parser_type(type ? type.first : :ruby)
|
155
|
+
end
|
156
|
+
|
157
|
+
# Returns the validated parser type. Basically, enforces that :ruby
|
158
|
+
# type is never set if the Ripper library is not available
|
159
|
+
#
|
160
|
+
# @param [Symbol] type the parser type to set
|
161
|
+
# @return [Symbol] the validated parser type
|
162
|
+
# @private
|
163
|
+
def validated_parser_type(type)
|
164
|
+
!defined?(::Ripper) && type == :ruby ? :ruby18 : type
|
165
|
+
end
|
166
|
+
|
167
|
+
# @group Parser Callbacks
|
168
|
+
|
169
|
+
# Registers a callback to be called before a list of files is parsed
|
170
|
+
# via {parse}. The block passed to this method will be called on
|
171
|
+
# subsequent parse calls.
|
172
|
+
#
|
173
|
+
# @example Installing a simple callback
|
174
|
+
# SourceParser.before_parse_list do |files, globals|
|
175
|
+
# puts "Starting to parse..."
|
176
|
+
# end
|
177
|
+
# YARD.parse('lib/**/*.rb')
|
178
|
+
# # prints "Starting to parse..."
|
179
|
+
#
|
180
|
+
# @example Setting global state
|
181
|
+
# SourceParser.before_parse_list do |files, globals|
|
182
|
+
# globals.method_count = 0
|
183
|
+
# end
|
184
|
+
# SourceParser.after_parse_list do |files, globals|
|
185
|
+
# puts "Found #{globals.method_count} methods"
|
186
|
+
# end
|
187
|
+
# class MyCountHandler < Handlers::Ruby::Base
|
188
|
+
# handles :def, :defs
|
189
|
+
# process { globals.method_count += 1 }
|
190
|
+
# end
|
191
|
+
# YARD.parse
|
192
|
+
# # Prints: "Found 37 methods"
|
193
|
+
#
|
194
|
+
# @example Using a global callback to cancel parsing
|
195
|
+
# SourceParser.before_parse_list do |files, globals|
|
196
|
+
# return false if files.include?('foo.rb')
|
197
|
+
# end
|
198
|
+
#
|
199
|
+
# YARD.parse(['foo.rb', 'bar.rb']) # callback cancels this method
|
200
|
+
# YARD.parse('bar.rb') # parses normally
|
201
|
+
#
|
202
|
+
# @yield [files, globals] the yielded block is called once before
|
203
|
+
# parsing all files
|
204
|
+
# @yieldparam [Array<String>] files the list of files that will be parsed.
|
205
|
+
# @yieldparam [OpenStruct] globals a global structure to store arbitrary
|
206
|
+
# state for post processing (see {Handlers::Processor#globals})
|
207
|
+
# @yieldreturn [Boolean] if the block returns +false+, parsing is
|
208
|
+
# cancelled.
|
209
|
+
# @return [Proc] the yielded block
|
210
|
+
# @see after_parse_list
|
211
|
+
# @see before_parse_file
|
212
|
+
# @since 0.7.0
|
213
|
+
def before_parse_list(&block)
|
214
|
+
before_parse_list_callbacks << block
|
215
|
+
end
|
216
|
+
|
217
|
+
# Registers a callback to be called after a list of files is parsed
|
218
|
+
# via {parse}. The block passed to this method will be called on
|
219
|
+
# subsequent parse calls.
|
220
|
+
#
|
221
|
+
# @example Printing results after parsing occurs
|
222
|
+
# SourceParser.after_parse_list do
|
223
|
+
# puts "Finished parsing!"
|
224
|
+
# end
|
225
|
+
# YARD.parse
|
226
|
+
# # Prints "Finished parsing!" after parsing files
|
227
|
+
# @yield [files, globals] the yielded block is called once before
|
228
|
+
# parsing all files
|
229
|
+
# @yieldparam [Array<String>] files the list of files that will be parsed.
|
230
|
+
# @yieldparam [OpenStruct] globals a global structure to store arbitrary
|
231
|
+
# state for post processing (see {Handlers::Processor#globals})
|
232
|
+
# @yieldreturn [void] the return value for the block is ignored.
|
233
|
+
# @return [Proc] the yielded block
|
234
|
+
# @see before_parse_list
|
235
|
+
# @see before_parse_file
|
236
|
+
# @since 0.7.0
|
237
|
+
def after_parse_list(&block)
|
238
|
+
after_parse_list_callbacks << block
|
239
|
+
end
|
240
|
+
|
241
|
+
# Registers a callback to be called before an individual file is parsed.
|
242
|
+
# The block passed to this method will be called on subsequent parse
|
243
|
+
# calls.
|
244
|
+
#
|
245
|
+
# To register a callback that is called before the entire list of files
|
246
|
+
# is processed, see {before_parse_list}.
|
247
|
+
#
|
248
|
+
# @example Installing a simple callback
|
249
|
+
# SourceParser.before_parse_file do |parser|
|
250
|
+
# puts "I'm parsing #{parser.file}"
|
251
|
+
# end
|
252
|
+
# YARD.parse('lib/**/*.rb')
|
253
|
+
# # prints:
|
254
|
+
# "I'm parsing lib/foo.rb"
|
255
|
+
# "I'm parsing lib/foo_bar.rb"
|
256
|
+
# "I'm parsing lib/last_file.rb"
|
257
|
+
#
|
258
|
+
# @example Cancel parsing of any test_*.rb files
|
259
|
+
# SourceParser.before_parse_file do |parser|
|
260
|
+
# return false if parser.file =~ /^test_.+\.rb$/
|
261
|
+
# end
|
262
|
+
#
|
263
|
+
# @yield [parser] the yielded block is called once before each
|
264
|
+
# file that is parsed. This might happen many times for a single
|
265
|
+
# codebase.
|
266
|
+
# @yieldparam [SourceParser] parser the parser object that will {#parse}
|
267
|
+
# the file.
|
268
|
+
# @yieldreturn [Boolean] if the block returns +false+, parsing for
|
269
|
+
# the file is cancelled.
|
270
|
+
# @return [Proc] the yielded block
|
271
|
+
# @see after_parse_file
|
272
|
+
# @see before_parse_list
|
273
|
+
# @since 0.7.0
|
274
|
+
def before_parse_file(&block)
|
275
|
+
before_parse_file_callbacks << block
|
276
|
+
end
|
277
|
+
|
278
|
+
# Registers a callback to be called after an individual file is parsed.
|
279
|
+
# The block passed to this method will be called on subsequent parse
|
280
|
+
# calls.
|
281
|
+
#
|
282
|
+
# To register a callback that is called after the entire list of files
|
283
|
+
# is processed, see {after_parse_list}.
|
284
|
+
#
|
285
|
+
# @example Printing the length of each file after it is parsed
|
286
|
+
# SourceParser.after_parse_file do |parser|
|
287
|
+
# puts "#{parser.file} is #{parser.contents.size} characters"
|
288
|
+
# end
|
289
|
+
# YARD.parse('lib/**/*.rb')
|
290
|
+
# # prints:
|
291
|
+
# "lib/foo.rb is 1240 characters"
|
292
|
+
# "lib/foo_bar.rb is 248 characters"
|
293
|
+
#
|
294
|
+
# @yield [parser] the yielded block is called once after each file
|
295
|
+
# that is parsed. This might happen many times for a single codebase.
|
296
|
+
# @yieldparam [SourceParser] parser the parser object that parsed
|
297
|
+
# the file.
|
298
|
+
# @yieldreturn [void] the return value for the block is ignored.
|
299
|
+
# @return [Proc] the yielded block
|
300
|
+
# @see before_parse_file
|
301
|
+
# @see after_parse_list
|
302
|
+
# @since 0.7.0
|
303
|
+
def after_parse_file(&block)
|
304
|
+
after_parse_file_callbacks << block
|
305
|
+
end
|
306
|
+
|
307
|
+
# @return [Array<Proc>] the list of callbacks to be called before
|
308
|
+
# parsing a list of files. Should only be used for testing.
|
309
|
+
# @since 0.7.0
|
310
|
+
def before_parse_list_callbacks
|
311
|
+
@before_parse_list_callbacks ||= []
|
312
|
+
end
|
313
|
+
|
314
|
+
# @return [Array<Proc>] the list of callbacks to be called after
|
315
|
+
# parsing a list of files. Should only be used for testing.
|
316
|
+
# @since 0.7.0
|
317
|
+
def after_parse_list_callbacks
|
318
|
+
@after_parse_list_callbacks ||= []
|
319
|
+
end
|
320
|
+
|
321
|
+
# @return [Array<Proc>] the list of callbacks to be called before
|
322
|
+
# parsing a file. Should only be used for testing.
|
323
|
+
# @since 0.7.0
|
324
|
+
def before_parse_file_callbacks
|
325
|
+
@before_parse_file_callbacks ||= []
|
326
|
+
end
|
327
|
+
|
328
|
+
# @return [Array<Proc>] the list of callbacks to be called after
|
329
|
+
# parsing a file. Should only be used for testing.
|
330
|
+
# @since 0.7.0
|
331
|
+
def after_parse_file_callbacks
|
332
|
+
@after_parse_file_callbacks ||= []
|
333
|
+
end
|
334
|
+
|
335
|
+
# @endgroup
|
336
|
+
|
337
|
+
private
|
338
|
+
|
339
|
+
# Parses a list of files in a queue. If a {LoadOrderError} is caught,
|
340
|
+
# the file is moved to the back of the queue with a Continuation object
|
341
|
+
# that can continue processing the file.
|
342
|
+
#
|
343
|
+
# @param [Array<String>] files a list of files to queue for parsing
|
344
|
+
# @return [void]
|
345
|
+
def parse_in_order(*files)
|
346
|
+
global_state = OpenStruct.new
|
347
|
+
files = files.sort_by {|x| x.length if x }
|
348
|
+
files_copy = files.dup
|
349
|
+
|
350
|
+
before_parse_list_callbacks.each do |cb|
|
351
|
+
return if cb.call(files_copy, global_state) == false
|
352
|
+
end
|
353
|
+
|
354
|
+
while file = files.shift
|
355
|
+
begin
|
356
|
+
if file.is_a?(Array) && file.last.is_a?(Continuation)
|
357
|
+
log.debug("Re-processing #{file.first}")
|
358
|
+
file.last.call
|
359
|
+
elsif file.is_a?(String)
|
360
|
+
log.debug("Processing #{file}...")
|
361
|
+
new(parser_type, true, global_state).parse(file)
|
362
|
+
end
|
363
|
+
rescue LoadOrderError => e
|
364
|
+
# Out of order file. Push the context to the end and we'll call it
|
365
|
+
files.push([file, e.context])
|
366
|
+
end
|
367
|
+
end
|
368
|
+
|
369
|
+
after_parse_list_callbacks.each do |cb|
|
370
|
+
cb.call(files_copy, global_state)
|
371
|
+
end
|
372
|
+
end
|
373
|
+
end
|
374
|
+
|
375
|
+
register_parser_type :ruby, Ruby::RubyParser
|
376
|
+
register_parser_type :ruby18, Ruby::Legacy::RubyParser
|
377
|
+
register_parser_type :c, CParser, ['c', 'cc', 'cxx', 'cpp']
|
378
|
+
|
379
|
+
self.parser_type = :ruby
|
380
|
+
|
381
|
+
# @return [String] the filename being parsed by the parser.
|
382
|
+
attr_reader :file
|
383
|
+
|
384
|
+
# @return [Symbol] the parser type associated with the parser instance.
|
385
|
+
# This should be set by the {#initialize constructor}.
|
386
|
+
attr_reader :parser_type
|
387
|
+
|
388
|
+
# @return [OpenStruct] an open struct containing arbitrary global state
|
389
|
+
# shared between files and handlers.
|
390
|
+
# @since 0.7.0
|
391
|
+
attr_reader :globals
|
392
|
+
|
393
|
+
# @return [String] the contents of the file to be parsed
|
394
|
+
# @since 0.7.0
|
395
|
+
attr_reader :contents
|
396
|
+
|
397
|
+
# Creates a new parser object for code parsing with a specific parser type.
|
398
|
+
#
|
399
|
+
# @param [Symbol] parser_type the parser type to use
|
400
|
+
# @param [Boolean] load_order_errors whether or not to raise the {LoadOrderError}
|
401
|
+
# @param [OpenStruct] globals global state to be re-used across separate source files
|
402
|
+
def initialize(parser_type = SourceParser.parser_type, load_order_errors = false, globals = nil)
|
403
|
+
@load_order_errors = load_order_errors
|
404
|
+
@file = '(stdin)'
|
405
|
+
@globals = globals || OpenStruct.new
|
406
|
+
self.parser_type = parser_type
|
407
|
+
end
|
408
|
+
|
409
|
+
# The main parser method. This should not be called directly. Instead,
|
410
|
+
# use the class methods {parse} and {parse_string}.
|
411
|
+
#
|
412
|
+
# @param [String, #read, Object] content the source file to parse
|
413
|
+
# @return [Object, nil] the parser object used to parse the source
|
414
|
+
def parse(content = __FILE__)
|
415
|
+
case content
|
416
|
+
when String
|
417
|
+
@file = File.cleanpath(content)
|
418
|
+
content = convert_encoding(File.read_binary(file))
|
419
|
+
checksum = Registry.checksum_for(content)
|
420
|
+
return if Registry.checksums[file] == checksum
|
421
|
+
|
422
|
+
if Registry.checksums.has_key?(file)
|
423
|
+
log.info "File '#{file}' was modified, re-processing..."
|
424
|
+
end
|
425
|
+
Registry.checksums[@file] = checksum
|
426
|
+
self.parser_type = parser_type_for_filename(file)
|
427
|
+
else
|
428
|
+
content = content.read if content.respond_to? :read
|
429
|
+
end
|
430
|
+
|
431
|
+
@contents = content
|
432
|
+
@parser = parser_class.new(content, file)
|
433
|
+
|
434
|
+
self.class.before_parse_file_callbacks.each do |cb|
|
435
|
+
return @parser if cb.call(self) == false
|
436
|
+
end
|
437
|
+
|
438
|
+
@parser.parse
|
439
|
+
post_process
|
440
|
+
|
441
|
+
self.class.after_parse_file_callbacks.each do |cb|
|
442
|
+
cb.call(self)
|
443
|
+
end
|
444
|
+
|
445
|
+
@parser
|
446
|
+
rescue ArgumentError, NotImplementedError => e
|
447
|
+
log.warn("Cannot parse `#{file}': #{e.message}")
|
448
|
+
log.backtrace(e) if log.level >= Logger::DEBUG
|
449
|
+
rescue ParserSyntaxError => e
|
450
|
+
log.warn(e.message.capitalize)
|
451
|
+
log.backtrace(e) if log.level >= Logger::DEBUG
|
452
|
+
end
|
453
|
+
|
454
|
+
# Tokenizes but does not parse the block of code using the current {#parser_type}
|
455
|
+
#
|
456
|
+
# @param [String] content the block of code to tokenize
|
457
|
+
# @return [Array] a list of tokens
|
458
|
+
def tokenize(content)
|
459
|
+
@parser = parser_class.new(content, file)
|
460
|
+
@parser.tokenize
|
461
|
+
end
|
462
|
+
|
463
|
+
private
|
464
|
+
|
465
|
+
# Searches for encoding line and forces encoding
|
466
|
+
# @since 0.5.3
|
467
|
+
def convert_encoding(content)
|
468
|
+
return content unless content.respond_to?(:force_encoding)
|
469
|
+
if content =~ ENCODING_LINE
|
470
|
+
content.force_encoding($1)
|
471
|
+
else
|
472
|
+
old_encoding = content.encoding
|
473
|
+
content.force_encoding('binary')
|
474
|
+
ENCODING_BYTE_ORDER_MARKS.each do |encoding, bom|
|
475
|
+
bom.force_encoding('binary')
|
476
|
+
if content[0,bom.size] == bom
|
477
|
+
content.force_encoding(encoding)
|
478
|
+
return content
|
479
|
+
end
|
480
|
+
end
|
481
|
+
content.force_encoding(old_encoding)
|
482
|
+
content
|
483
|
+
end
|
484
|
+
end
|
485
|
+
|
486
|
+
# Runs a {Handlers::Processor} object to post process the parsed statements.
|
487
|
+
# @return [void]
|
488
|
+
def post_process
|
489
|
+
return unless @parser.respond_to? :enumerator
|
490
|
+
return unless enumerator = @parser.enumerator
|
491
|
+
post = Handlers::Processor.new(@file, @load_order_errors, @parser_type, @globals)
|
492
|
+
post.process(enumerator)
|
493
|
+
end
|
494
|
+
|
495
|
+
def parser_type=(value)
|
496
|
+
@parser_type = self.class.validated_parser_type(value)
|
497
|
+
end
|
498
|
+
|
499
|
+
# Guesses the parser type to use depending on the file extension.
|
500
|
+
#
|
501
|
+
# @param [String] filename the filename to use to guess the parser type
|
502
|
+
# @return [Symbol] a parser type that matches the filename
|
503
|
+
def parser_type_for_filename(filename)
|
504
|
+
ext = (File.extname(filename)[1..-1] || "").downcase
|
505
|
+
type = self.class.parser_type_for_extension(ext)
|
506
|
+
parser_type == :ruby18 && type == :ruby ? :ruby18 : type
|
507
|
+
end
|
508
|
+
|
509
|
+
# @since 0.5.6
|
510
|
+
def parser_class
|
511
|
+
klass = self.class.parser_types[parser_type]
|
512
|
+
raise ArgumentError, "invalid parser type '#{parser_type}' or unrecognized file", caller[1..-1] if !klass
|
513
|
+
klass
|
514
|
+
end
|
515
|
+
end
|
516
|
+
end
|
517
|
+
end
|