yard 0.2.3.5 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of yard might be problematic. Click here for more details.
- data/.yardopts +12 -10
- data/ChangeLog +5686 -0
- data/{README.markdown → README.md} +65 -11
- data/Rakefile +25 -13
- data/benchmarks/concat_vs_join.rb +12 -0
- data/benchmarks/erb_vs_erubis.rb +14 -14
- data/benchmarks/marshal_vs_dbm.rb +1 -1
- data/benchmarks/pathname_vs_string.rb +50 -0
- data/benchmarks/template_erb.rb +22 -0
- data/benchmarks/template_format.rb +6 -0
- data/benchmarks/template_profile.rb +17 -0
- data/bin/yri +16 -7
- data/docs/{CODE_OBJECTS.markdown → CodeObjects.md} +0 -0
- data/docs/{GETTING_STARTED.markdown → GettingStarted.md} +49 -11
- data/docs/{GLOSSARY.markdown → Glossary.md} +0 -0
- data/docs/{HANDLERS.markdown → Handlers.md} +5 -5
- data/docs/{OVERVIEW.markdown → Overview.md} +9 -13
- data/docs/{PARSER.markdown → Parser.md} +1 -1
- data/docs/{TAGS.markdown → Tags.md} +1 -1
- data/docs/Templates.md +286 -0
- data/docs/{WHATSNEW.markdown → WhatsNew.md} +82 -2
- data/lib/rubygems_plugin.rb +17 -20
- data/lib/yard.rb +47 -1
- data/lib/yard/autoload.rb +38 -47
- data/lib/yard/cli/yard_graph.rb +36 -13
- data/lib/yard/cli/yardoc.rb +74 -12
- data/lib/yard/code_objects/base.rb +182 -14
- data/lib/yard/code_objects/class_object.rb +39 -2
- data/lib/yard/code_objects/class_variable_object.rb +4 -0
- data/lib/yard/code_objects/constant_object.rb +8 -0
- data/lib/yard/code_objects/extended_method_object.rb +14 -0
- data/lib/yard/code_objects/method_object.rb +60 -2
- data/lib/yard/code_objects/module_object.rb +6 -0
- data/lib/yard/code_objects/namespace_object.rb +99 -2
- data/lib/yard/code_objects/proxy.rb +53 -6
- data/lib/yard/code_objects/root_object.rb +2 -0
- data/lib/yard/core_ext/array.rb +61 -0
- data/lib/yard/core_ext/file.rb +21 -4
- data/lib/yard/core_ext/module.rb +11 -1
- data/lib/yard/core_ext/string.rb +13 -2
- data/lib/yard/core_ext/symbol_hash.rb +51 -3
- data/lib/yard/docstring.rb +68 -19
- data/lib/yard/globals.rb +5 -2
- data/lib/yard/handlers/base.rb +13 -3
- data/lib/yard/handlers/processor.rb +64 -2
- data/lib/yard/handlers/ruby/class_handler.rb +1 -1
- data/lib/yard/handlers/ruby/class_variable_handler.rb +5 -1
- data/lib/yard/handlers/ruby/constant_handler.rb +38 -4
- data/lib/yard/handlers/ruby/exception_handler.rb +1 -0
- data/lib/yard/handlers/ruby/legacy/base.rb +2 -2
- data/lib/yard/handlers/ruby/legacy/class_variable_handler.rb +6 -3
- data/lib/yard/handlers/ruby/legacy/constant_handler.rb +21 -2
- data/lib/yard/handlers/ruby/legacy/method_handler.rb +10 -0
- data/lib/yard/handlers/ruby/legacy/yield_handler.rb +2 -1
- data/lib/yard/handlers/ruby/method_handler.rb +10 -0
- data/lib/yard/handlers/ruby/yield_handler.rb +2 -1
- data/lib/yard/logging.rb +17 -0
- data/lib/yard/parser/ruby/ast_node.rb +101 -0
- data/lib/yard/parser/ruby/legacy/ruby_lex.rb +2 -2
- data/lib/yard/parser/ruby/legacy/statement_list.rb +10 -9
- data/lib/yard/parser/ruby/ruby_parser.rb +32 -3
- data/lib/yard/parser/source_parser.rb +82 -5
- data/lib/yard/rake/yardoc_task.rb +38 -3
- data/lib/yard/registry.rb +112 -2
- data/lib/yard/serializers/base.rb +48 -1
- data/lib/yard/serializers/file_system_serializer.rb +23 -2
- data/lib/yard/serializers/process_serializer.rb +10 -0
- data/lib/yard/serializers/stdout_serializer.rb +11 -0
- data/lib/yard/tags/library.rb +4 -1
- data/lib/yard/tags/overload_tag.rb +3 -12
- data/lib/yard/templates/engine.rb +162 -0
- data/lib/yard/{generators → templates}/helpers/base_helper.rb +14 -13
- data/lib/yard/{generators → templates}/helpers/filter_helper.rb +1 -1
- data/lib/yard/templates/helpers/html_helper.rb +287 -0
- data/lib/yard/templates/helpers/html_syntax_highlight_helper.rb +29 -0
- data/lib/yard/templates/helpers/html_syntax_highlight_helper18.rb +27 -0
- data/lib/yard/{generators → templates}/helpers/markup_helper.rb +15 -11
- data/lib/yard/{generators → templates}/helpers/method_helper.rb +8 -1
- data/lib/yard/templates/helpers/module_helper.rb +15 -0
- data/lib/yard/templates/helpers/text_helper.rb +60 -0
- data/lib/yard/templates/helpers/uml_helper.rb +33 -0
- data/lib/yard/templates/template.rb +355 -0
- data/lib/yard/verifier.rb +110 -0
- data/spec/cli/yardoc_spec.rb +23 -1
- data/spec/code_objects/base_spec.rb +8 -0
- data/spec/code_objects/class_object_spec.rb +166 -156
- data/spec/code_objects/method_object_spec.rb +2 -2
- data/spec/code_objects/module_object_spec.rb +112 -110
- data/spec/code_objects/proxy_spec.rb +9 -0
- data/spec/core_ext/array_spec.rb +33 -0
- data/spec/core_ext/file_spec.rb +40 -12
- data/spec/core_ext/module_spec.rb +15 -0
- data/spec/core_ext/string_spec.rb +10 -2
- data/spec/docstring_spec.rb +157 -135
- data/spec/handlers/class_handler_spec.rb +3 -0
- data/spec/handlers/class_variable_handler_spec.rb +3 -1
- data/spec/handlers/constant_handler_spec.rb +38 -0
- data/spec/handlers/examples/class_handler_001.rb.txt +14 -1
- data/spec/handlers/examples/class_variable_handler_001.rb.txt +1 -0
- data/spec/handlers/examples/constant_handler_001.rb.txt +10 -1
- data/spec/handlers/examples/exception_handler_001.rb.txt +5 -0
- data/spec/handlers/examples/method_handler_001.rb.txt +15 -0
- data/spec/handlers/examples/mixin_handler_001.rb.txt +13 -0
- data/spec/handlers/exception_handler_spec.rb +4 -0
- data/spec/handlers/method_handler_spec.rb +22 -0
- data/spec/handlers/mixin_handler_spec.rb +5 -3
- data/spec/handlers/yield_handler_spec.rb +1 -1
- data/spec/parser/ruby/ast_node_spec.rb +16 -0
- data/spec/parser/ruby/legacy/statement_list_spec.rb +36 -0
- data/spec/parser/ruby/ruby_parser_spec.rb +80 -0
- data/spec/parser/source_parser_spec.rb +48 -2
- data/spec/rake/yardoc_task_spec.rb +62 -25
- data/spec/serializers/file_system_serializer_spec.rb +1 -1
- data/spec/templates/class_spec.rb +34 -0
- data/spec/templates/engine_spec.rb +121 -0
- data/spec/templates/examples/class001.html +271 -0
- data/spec/templates/examples/class001.txt +31 -0
- data/spec/templates/examples/method001.html +96 -0
- data/spec/templates/examples/method001.txt +28 -0
- data/spec/templates/examples/method002.html +81 -0
- data/spec/templates/examples/method002.txt +20 -0
- data/spec/templates/examples/method003.html +137 -0
- data/spec/templates/examples/method003.txt +45 -0
- data/spec/templates/examples/module001.dot +31 -0
- data/spec/templates/examples/module001.html +294 -0
- data/spec/templates/examples/module001.txt +33 -0
- data/spec/templates/examples/tag001.txt +82 -0
- data/spec/templates/helpers/base_helper_spec.rb +129 -0
- data/spec/{generators → templates}/helpers/html_helper_spec.rb +73 -16
- data/spec/templates/helpers/html_syntax_highlight_helper_spec.rb +39 -0
- data/spec/{generators → templates}/helpers/markup_helper_spec.rb +6 -7
- data/spec/templates/method_spec.rb +75 -0
- data/spec/templates/module_spec.rb +50 -0
- data/spec/templates/spec_helper.rb +33 -0
- data/spec/templates/tag_spec.rb +39 -0
- data/spec/templates/template_spec.rb +398 -0
- data/spec/verifier_spec.rb +51 -0
- data/spec/yard_spec.rb +46 -0
- data/templates/default/class/dot/setup.rb +6 -0
- data/templates/default/class/dot/superklass.erb +3 -0
- data/templates/default/class/html/constructor_details.erb +8 -0
- data/templates/default/class/html/setup.rb +1 -0
- data/templates/default/class/html/subclasses.erb +4 -0
- data/templates/default/class/setup.rb +29 -0
- data/templates/default/class/text/setup.rb +11 -0
- data/templates/default/class/text/subclasses.erb +5 -0
- data/templates/default/docstring/html/abstract.erb +4 -0
- data/templates/default/docstring/html/deprecated.erb +1 -0
- data/templates/default/docstring/html/index.erb +5 -0
- data/templates/default/docstring/html/note.erb +6 -0
- data/templates/default/docstring/html/text.erb +1 -0
- data/templates/default/docstring/html/todo.erb +6 -0
- data/templates/default/docstring/setup.rb +39 -0
- data/templates/default/docstring/text/abstract.erb +2 -0
- data/templates/default/docstring/text/deprecated.erb +2 -0
- data/templates/default/docstring/text/index.erb +2 -0
- data/templates/default/docstring/text/note.erb +4 -0
- data/templates/default/docstring/text/text.erb +1 -0
- data/templates/default/docstring/text/todo.erb +4 -0
- data/templates/default/fulldoc/html/css/common.css +1 -0
- data/templates/default/fulldoc/html/css/full_list.css +23 -0
- data/templates/default/fulldoc/html/css/style.css +261 -0
- data/templates/default/fulldoc/html/full_list.erb +36 -0
- data/templates/default/fulldoc/html/js/app.js +91 -0
- data/templates/default/fulldoc/html/js/full_list.js +39 -0
- data/templates/default/fulldoc/html/js/jquery.js +19 -0
- data/templates/default/fulldoc/html/setup.rb +86 -0
- data/templates/default/{uml → layout}/dot/header.erb +2 -2
- data/templates/default/layout/dot/setup.rb +14 -0
- data/templates/default/layout/html/breadcrumb.erb +11 -0
- data/templates/default/layout/html/footer.erb +5 -0
- data/templates/default/layout/html/headers.erb +13 -0
- data/templates/default/layout/html/index.erb +49 -0
- data/templates/default/layout/html/layout.erb +20 -0
- data/templates/default/layout/html/search.erb +5 -0
- data/templates/default/layout/html/setup.rb +58 -0
- data/templates/default/method/html/header.erb +14 -3
- data/templates/default/method/setup.rb +3 -0
- data/templates/default/method/text/header.erb +1 -1
- data/templates/default/method_details/html/header.erb +3 -0
- data/templates/default/method_details/html/method_signature.erb +17 -0
- data/templates/default/method_details/html/source.erb +10 -0
- data/templates/default/method_details/setup.rb +8 -0
- data/templates/default/method_details/text/header.erb +10 -0
- data/templates/default/method_details/text/method_signature.erb +12 -0
- data/templates/default/method_details/text/setup.rb +10 -0
- data/templates/default/module/dot/child.erb +1 -0
- data/templates/default/module/dot/dependencies.erb +3 -0
- data/templates/default/{uml/dot/subgraph.erb → module/dot/header.erb} +3 -3
- data/templates/default/{uml → module}/dot/info.erb +4 -4
- data/templates/default/module/dot/setup.rb +14 -0
- data/templates/default/module/html/attribute_details.erb +11 -0
- data/templates/default/module/html/attribute_summary.erb +8 -0
- data/templates/default/module/html/box_info.erb +32 -0
- data/templates/default/module/html/children.erb +8 -0
- data/templates/default/module/html/constant_summary.erb +13 -0
- data/templates/default/module/html/defines.erb +3 -0
- data/templates/default/module/html/header.erb +4 -4
- data/templates/default/module/html/inherited_constants.erb +8 -0
- data/templates/default/module/html/inherited_methods.erb +9 -0
- data/templates/default/module/html/item_summary.erb +20 -0
- data/templates/default/module/html/method_details_list.erb +8 -0
- data/templates/default/module/html/method_summary.erb +8 -0
- data/templates/default/module/html/methodmissing.erb +12 -0
- data/templates/default/module/html/pre_docstring.erb +1 -0
- data/templates/default/module/setup.rb +83 -0
- data/templates/default/module/text/children.erb +10 -0
- data/templates/default/module/text/class_meths_list.erb +8 -0
- data/templates/default/module/text/extends.erb +8 -0
- data/templates/default/module/text/header.erb +7 -0
- data/templates/default/module/text/includes.erb +8 -0
- data/templates/default/module/text/instance_meths_list.erb +8 -0
- data/templates/default/module/text/setup.rb +12 -0
- data/templates/default/root/dot/child.erb +3 -0
- data/templates/default/root/dot/setup.rb +5 -0
- data/templates/default/tags/html/example.erb +5 -16
- data/templates/default/tags/html/index.erb +3 -0
- data/templates/default/tags/html/option.erb +17 -20
- data/templates/default/tags/html/overload.erb +13 -0
- data/templates/default/tags/html/see.erb +5 -10
- data/templates/default/tags/html/tag.erb +20 -0
- data/templates/default/tags/setup.rb +50 -0
- data/templates/default/tags/text/example.erb +8 -10
- data/templates/default/tags/text/index.erb +1 -0
- data/templates/default/tags/text/option.erb +18 -3
- data/templates/default/tags/text/overload.erb +19 -0
- data/templates/default/tags/text/see.erb +8 -2
- data/templates/default/tags/text/tag.erb +13 -0
- metadata +142 -158
- data/bin/view_generator +0 -17
- data/docs/FAQ.markdown +0 -34
- data/docs/GENERATORS.markdown +0 -211
- data/lib/yard/generators/attributes_generator.rb +0 -22
- data/lib/yard/generators/base.rb +0 -305
- data/lib/yard/generators/class_generator.rb +0 -27
- data/lib/yard/generators/constants_generator.rb +0 -74
- data/lib/yard/generators/constructor_generator.rb +0 -25
- data/lib/yard/generators/deprecated_generator.rb +0 -15
- data/lib/yard/generators/docstring_generator.rb +0 -15
- data/lib/yard/generators/full_doc_generator.rb +0 -127
- data/lib/yard/generators/helpers/html_helper.rb +0 -196
- data/lib/yard/generators/helpers/html_syntax_highlight_helper.rb +0 -49
- data/lib/yard/generators/helpers/uml_helper.rb +0 -16
- data/lib/yard/generators/inheritance_generator.rb +0 -16
- data/lib/yard/generators/method_details_generator.rb +0 -18
- data/lib/yard/generators/method_generator.rb +0 -43
- data/lib/yard/generators/method_listing_generator.rb +0 -105
- data/lib/yard/generators/method_missing_generator.rb +0 -25
- data/lib/yard/generators/method_signature_generator.rb +0 -19
- data/lib/yard/generators/method_summary_generator.rb +0 -21
- data/lib/yard/generators/mixins_generator.rb +0 -21
- data/lib/yard/generators/module_generator.rb +0 -23
- data/lib/yard/generators/overloads_generator.rb +0 -20
- data/lib/yard/generators/quick_doc_generator.rb +0 -25
- data/lib/yard/generators/root_generator.rb +0 -32
- data/lib/yard/generators/source_generator.rb +0 -11
- data/lib/yard/generators/tags_generator.rb +0 -99
- data/lib/yard/generators/uml_generator.rb +0 -102
- data/lib/yard/generators/visibility_group_generator.rb +0 -26
- data/spec/generators/base_spec.rb +0 -64
- data/spec/generators/full_doc_generator_spec.rb +0 -29
- data/spec/generators/helpers/base_helper_spec.rb +0 -15
- data/spec/generators/quick_doc_generator_spec.rb +0 -13
- data/templates/default/attributes/html/header.erb +0 -47
- data/templates/default/attributes/text/header.erb +0 -10
- data/templates/default/class/html/header.erb +0 -4
- data/templates/default/constants/html/constants.erb +0 -9
- data/templates/default/constants/html/header.erb +0 -3
- data/templates/default/constants/html/included.erb +0 -9
- data/templates/default/constants/html/inherited.erb +0 -9
- data/templates/default/constructor/html/header.erb +0 -10
- data/templates/default/deprecated/html/main.erb +0 -6
- data/templates/default/deprecated/text/main.erb +0 -3
- data/templates/default/docstring/html/main.erb +0 -3
- data/templates/default/docstring/text/main.erb +0 -3
- data/templates/default/fulldoc/html/all_files.erb +0 -19
- data/templates/default/fulldoc/html/all_methods.erb +0 -26
- data/templates/default/fulldoc/html/all_namespaces.erb +0 -22
- data/templates/default/fulldoc/html/app.js +0 -18
- data/templates/default/fulldoc/html/custom.css +0 -1
- data/templates/default/fulldoc/html/file.erb +0 -16
- data/templates/default/fulldoc/html/footer.erb +0 -5
- data/templates/default/fulldoc/html/header.erb +0 -16
- data/templates/default/fulldoc/html/html_head.erb +0 -4
- data/templates/default/fulldoc/html/index.erb +0 -19
- data/templates/default/fulldoc/html/jquery.js +0 -11
- data/templates/default/fulldoc/html/style.css +0 -81
- data/templates/default/fulldoc/html/syntax_highlight.css +0 -24
- data/templates/default/inheritance/html/header.erb +0 -8
- data/templates/default/inheritance/text/header.erb +0 -3
- data/templates/default/method/html/aliases.erb +0 -6
- data/templates/default/method/html/title.erb +0 -3
- data/templates/default/method/text/title.erb +0 -1
- data/templates/default/methoddetails/html/header.erb +0 -8
- data/templates/default/methoddetails/html/method_header.erb +0 -3
- data/templates/default/methodmissing/html/header.erb +0 -12
- data/templates/default/methodsignature/html/main.erb +0 -10
- data/templates/default/methodsignature/text/main.erb +0 -8
- data/templates/default/methodsummary/html/header.erb +0 -5
- data/templates/default/methodsummary/html/included.erb +0 -9
- data/templates/default/methodsummary/html/inherited.erb +0 -9
- data/templates/default/methodsummary/html/summary.erb +0 -29
- data/templates/default/methodsummary/text/header.erb +0 -5
- data/templates/default/methodsummary/text/included.erb +0 -0
- data/templates/default/methodsummary/text/inherited.erb +0 -0
- data/templates/default/methodsummary/text/summary.erb +0 -6
- data/templates/default/mixins/html/header.erb +0 -4
- data/templates/default/overloads/html/header.erb +0 -8
- data/templates/default/overloads/text/header.erb +0 -8
- data/templates/default/quickdoc/html/header.erb +0 -15
- data/templates/default/quickdoc/text/header.erb +0 -12
- data/templates/default/root/html/header.erb +0 -4
- data/templates/default/source/html/main.erb +0 -15
- data/templates/default/source/text/main.erb +0 -4
- data/templates/default/tags/html/header.erb +0 -4
- data/templates/default/tags/html/param.erb +0 -21
- data/templates/default/tags/html/tags.erb +0 -23
- data/templates/default/tags/html/todo.erb +0 -8
- data/templates/default/tags/text/header.erb +0 -3
- data/templates/default/tags/text/param.erb +0 -9
- data/templates/default/tags/text/tags.erb +0 -7
- data/templates/default/uml/dot/child.erb +0 -1
- data/templates/default/uml/dot/dependencies.erb +0 -10
- data/templates/default/uml/dot/superclasses.erb +0 -9
- data/templates/default/uml/dot/unknown.erb +0 -3
- data/templates/default/uml/dot/unknown_child.erb +0 -1
- data/templates/default/visibilitygroup/html/header.erb +0 -6
- data/templates/javadoc/attributes/html/header.erb +0 -16
- data/templates/javadoc/class/html/header.erb +0 -4
- data/templates/javadoc/constants/html/constants.erb +0 -9
- data/templates/javadoc/constants/html/header.erb +0 -3
- data/templates/javadoc/constants/html/included.erb +0 -12
- data/templates/javadoc/constants/html/inherited.erb +0 -12
- data/templates/javadoc/constructor/html/header.erb +0 -10
- data/templates/javadoc/deprecated/html/main.erb +0 -0
- data/templates/javadoc/docstring/html/main.erb +0 -6
- data/templates/javadoc/fulldoc/html/all_methods.erb +0 -25
- data/templates/javadoc/fulldoc/html/all_namespaces.erb +0 -19
- data/templates/javadoc/fulldoc/html/app.js +0 -18
- data/templates/javadoc/fulldoc/html/header.erb +0 -15
- data/templates/javadoc/fulldoc/html/html_head.erb +0 -3
- data/templates/javadoc/fulldoc/html/index.erb +0 -18
- data/templates/javadoc/fulldoc/html/jquery.js +0 -11
- data/templates/javadoc/fulldoc/html/readme.erb +0 -15
- data/templates/javadoc/fulldoc/html/style.css +0 -22
- data/templates/javadoc/fulldoc/html/syntax_highlight.css +0 -21
- data/templates/javadoc/inheritance/html/header.erb +0 -6
- data/templates/javadoc/method/html/aliases.erb +0 -6
- data/templates/javadoc/method/html/header.erb +0 -4
- data/templates/javadoc/method/html/title.erb +0 -4
- data/templates/javadoc/methoddetails/html/header.erb +0 -8
- data/templates/javadoc/methoddetails/html/method_header.erb +0 -0
- data/templates/javadoc/methodmissing/html/header.erb +0 -12
- data/templates/javadoc/methodsignature/html/main.erb +0 -8
- data/templates/javadoc/methodsummary/html/header.erb +0 -5
- data/templates/javadoc/methodsummary/html/included.erb +0 -12
- data/templates/javadoc/methodsummary/html/inherited.erb +0 -12
- data/templates/javadoc/methodsummary/html/summary.erb +0 -25
- data/templates/javadoc/mixins/html/header.erb +0 -5
- data/templates/javadoc/module/html/header.erb +0 -4
- data/templates/javadoc/source/html/main.erb +0 -15
- data/templates/javadoc/tags/html/header.erb +0 -5
- data/templates/javadoc/tags/html/see.erb +0 -8
- data/templates/javadoc/tags/html/tags.erb +0 -19
- data/templates/javadoc/visibilitygroup/html/header.erb +0 -5
data/lib/rubygems_plugin.rb
CHANGED
@@ -14,7 +14,6 @@ class Gem::Specification
|
|
14
14
|
@has_rdoc == 'yard'
|
15
15
|
end
|
16
16
|
|
17
|
-
undef has_rdoc? # redefining
|
18
17
|
def has_rdoc?
|
19
18
|
@has_rdoc && @has_rdoc != 'yard'
|
20
19
|
end
|
@@ -43,18 +42,16 @@ class Gem::DocManager
|
|
43
42
|
rescue Errno::EACCES => e
|
44
43
|
dirname = File.dirname e.message.split("-")[1].strip
|
45
44
|
raise Gem::FilePermissionError.new(dirname)
|
46
|
-
rescue
|
45
|
+
rescue => ex
|
47
46
|
alert_error "While generating documentation for #{@spec.full_name}"
|
48
47
|
ui.errs.puts "... MESSAGE: #{ex}"
|
49
48
|
ui.errs.puts "... YARDDOC args: #{args.join(' ')}"
|
50
|
-
ui.errs.puts "\t#{ex.backtrace.join
|
51
|
-
Gem.configuration.backtrace
|
49
|
+
ui.errs.puts "\t#{ex.backtrace.join("\n\t")}" if Gem.configuration.backtrace
|
52
50
|
ui.errs.puts "(continuing with the rest of the installation)"
|
53
51
|
ensure
|
54
52
|
Dir.chdir(old_pwd)
|
55
53
|
end
|
56
54
|
|
57
|
-
undef setup_rdoc # redefining
|
58
55
|
def setup_rdoc
|
59
56
|
if File.exist?(@doc_dir) && !File.writable?(@doc_dir) then
|
60
57
|
raise Gem::FilePermissionError.new(@doc_dir)
|
@@ -75,21 +72,21 @@ class Gem::DocManager
|
|
75
72
|
run_yardoc '-o', rdoc_dir
|
76
73
|
end
|
77
74
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
75
|
+
unless instance_methods.include?(:install_ri_yard)
|
76
|
+
def install_ri_yard
|
77
|
+
install_ri_yard_orig if @spec.has_rdoc?
|
78
|
+
end
|
79
|
+
alias install_ri_yard_orig install_ri
|
80
|
+
alias install_ri install_ri_yard
|
81
|
+
|
82
|
+
def install_rdoc_yard
|
83
|
+
if @spec.has_rdoc?
|
84
|
+
install_rdoc_yard_orig
|
85
|
+
elsif @spec.has_yardoc?
|
86
|
+
install_yardoc
|
87
|
+
end
|
90
88
|
end
|
89
|
+
alias install_rdoc_yard_orig install_rdoc
|
90
|
+
alias install_rdoc install_rdoc_yard
|
91
91
|
end
|
92
|
-
@@install_rdoc_yard_orig = instance_method(:install_rdoc)
|
93
|
-
undef install_rdoc # redefining
|
94
|
-
alias install_rdoc install_rdoc_yard
|
95
92
|
end
|
data/lib/yard.rb
CHANGED
@@ -1,10 +1,48 @@
|
|
1
1
|
module YARD
|
2
|
-
VERSION = "0.
|
2
|
+
VERSION = "0.4.0"
|
3
3
|
ROOT = File.dirname(__FILE__)
|
4
4
|
TEMPLATE_ROOT = File.join(File.dirname(__FILE__), '..', 'templates')
|
5
|
+
CONFIG_DIR = File.expand_path('~/.yard')
|
5
6
|
|
7
|
+
# An alias to {Parser::SourceParser}'s parsing method
|
8
|
+
#
|
9
|
+
# @example Parse a glob of files
|
10
|
+
# YARD.parse('lib/**/*.rb')
|
11
|
+
# @see Parser::SourceParser.parse
|
6
12
|
def self.parse(*args) Parser::SourceParser.parse(*args) end
|
13
|
+
|
14
|
+
# An alias to {Parser::SourceParser}'s parsing method
|
15
|
+
#
|
16
|
+
# @example Parse a string of input
|
17
|
+
# YARD.parse_string('class Foo; end')
|
18
|
+
# @see Parser::SourceParser.parse_string
|
7
19
|
def self.parse_string(*args) Parser::SourceParser.parse_string(*args) end
|
20
|
+
|
21
|
+
# Loads gems that match the name 'yard-*' (recommended) or 'yard_*' except
|
22
|
+
# those listed in +~/.yard/ignored_plugins+. This is called immediately
|
23
|
+
# after YARD is loaded to allow plugin support.
|
24
|
+
#
|
25
|
+
# @return [true] always returns true
|
26
|
+
def self.load_plugins
|
27
|
+
ignored_plugins_file = File.join(CONFIG_DIR, "ignored_plugins")
|
28
|
+
if File.file?(ignored_plugins_file)
|
29
|
+
ignored_plugins = IO.read(ignored_plugins_file).split(/\s+/)
|
30
|
+
else
|
31
|
+
ignored_plugins = []
|
32
|
+
end
|
33
|
+
|
34
|
+
Gem.source_index.entries.each do |pkgname, gem|
|
35
|
+
begin
|
36
|
+
if gem.name =~ /^yard[-_]/ && !ignored_plugins.include?(gem.name)
|
37
|
+
log.debug "Loading plugin '#{gem.name}'..."
|
38
|
+
require gem.name
|
39
|
+
end
|
40
|
+
rescue Gem::LoadError, LoadError
|
41
|
+
log.warn "Error loading plugin '#{gem.name}'"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
true
|
45
|
+
end
|
8
46
|
end
|
9
47
|
|
10
48
|
# Ruby 1.9.2 removes '.' which is not exactly a good idea
|
@@ -21,3 +59,11 @@ end
|
|
21
59
|
['autoload', 'globals'].each do |file|
|
22
60
|
require File.join(YARD::ROOT, 'yard', file)
|
23
61
|
end
|
62
|
+
|
63
|
+
# Load any plugins
|
64
|
+
begin
|
65
|
+
require 'rubygems'
|
66
|
+
YARD.load_plugins
|
67
|
+
rescue LoadError
|
68
|
+
log.debug "RubyGems is not present, skipping plugin loading"
|
69
|
+
end
|
data/lib/yard/autoload.rb
CHANGED
@@ -1,12 +1,17 @@
|
|
1
|
+
# @private
|
1
2
|
def __p(*path) File.join(YARD::ROOT, 'yard', *path) end
|
2
3
|
|
3
4
|
module YARD
|
4
|
-
module CLI
|
5
|
+
module CLI # Namespace for command-line interface components
|
5
6
|
autoload :YardGraph, __p('cli/yard_graph')
|
6
7
|
autoload :Yardoc, __p('cli/yardoc')
|
7
8
|
end
|
8
9
|
|
9
|
-
|
10
|
+
# A "code object" is defined as any entity in the Ruby language.
|
11
|
+
# Classes, modules, methods, class variables and constants are the
|
12
|
+
# major objects, but DSL languages can create their own by inheriting
|
13
|
+
# from {CodeObjects::Base}.
|
14
|
+
module CodeObjects
|
10
15
|
autoload :Base, __p('code_objects/base')
|
11
16
|
autoload :CodeObjectList, __p('code_objects/base')
|
12
17
|
autoload :ClassObject, __p('code_objects/class_object')
|
@@ -35,47 +40,13 @@ module YARD
|
|
35
40
|
autoload :CSEP, __p('code_objects/base')
|
36
41
|
autoload :CSEPQ, __p('code_objects/base')
|
37
42
|
end
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
autoload :FilterHelper, __p('generators/helpers/filter_helper')
|
43
|
-
autoload :HtmlHelper, __p('generators/helpers/html_helper')
|
44
|
-
autoload :HtmlSyntaxHighlightHelper, __p('generators/helpers/html_syntax_highlight_helper')
|
45
|
-
autoload :MarkupHelper, __p('generators/helpers/markup_helper')
|
46
|
-
autoload :MethodHelper, __p('generators/helpers/method_helper')
|
47
|
-
autoload :UMLHelper, __p('generators/helpers/uml_helper')
|
48
|
-
end
|
49
|
-
|
50
|
-
autoload :AttributesGenerator, __p('generators/attributes_generator')
|
51
|
-
autoload :Base, __p('generators/base')
|
52
|
-
autoload :ClassGenerator, __p('generators/class_generator')
|
53
|
-
autoload :ConstantsGenerator, __p('generators/constants_generator')
|
54
|
-
autoload :ConstructorGenerator, __p('generators/constructor_generator')
|
55
|
-
autoload :DeprecatedGenerator, __p('generators/deprecated_generator')
|
56
|
-
autoload :DocstringGenerator, __p('generators/docstring_generator')
|
57
|
-
autoload :FullDocGenerator, __p('generators/full_doc_generator')
|
58
|
-
autoload :InheritanceGenerator, __p('generators/inheritance_generator')
|
59
|
-
autoload :MethodGenerator, __p('generators/method_generator')
|
60
|
-
autoload :MethodDetailsGenerator, __p('generators/method_details_generator')
|
61
|
-
autoload :MethodListingGenerator, __p('generators/method_listing_generator')
|
62
|
-
autoload :MethodMissingGenerator, __p('generators/method_missing_generator')
|
63
|
-
autoload :MethodSignatureGenerator, __p('generators/method_signature_generator')
|
64
|
-
autoload :MethodSummaryGenerator, __p('generators/method_summary_generator')
|
65
|
-
autoload :MixinsGenerator, __p('generators/mixins_generator')
|
66
|
-
autoload :ModuleGenerator, __p('generators/module_generator')
|
67
|
-
autoload :QuickDocGenerator, __p('generators/quick_doc_generator')
|
68
|
-
autoload :RootGenerator, __p('generators/root_generator')
|
69
|
-
autoload :SourceGenerator, __p('generators/source_generator')
|
70
|
-
autoload :TagsGenerator, __p('generators/tags_generator')
|
71
|
-
autoload :UMLGenerator, __p('generators/uml_generator')
|
72
|
-
autoload :VisibilityGroupGenerator, __p('generators/visibility_group_generator')
|
73
|
-
autoload :OverloadsGenerator, __p('generators/overloads_generator')
|
74
|
-
end
|
75
|
-
|
43
|
+
|
44
|
+
# Handlers are called during the data processing part of YARD's
|
45
|
+
# parsing phase. This allows YARD as well as any custom extension to
|
46
|
+
# analyze source and generate {CodeObjects} to be stored for later use.
|
76
47
|
module Handlers
|
77
|
-
module Ruby
|
78
|
-
module Legacy
|
48
|
+
module Ruby # All Ruby handlers
|
49
|
+
module Legacy # Handlers for old Ruby 1.8 parser
|
79
50
|
autoload :Base, __p('handlers/ruby/legacy/base')
|
80
51
|
|
81
52
|
autoload :AliasHandler, __p('handlers/ruby/legacy/alias_handler')
|
@@ -114,9 +85,11 @@ module YARD
|
|
114
85
|
autoload :Processor, __p('handlers/processor')
|
115
86
|
end
|
116
87
|
|
88
|
+
# The parser namespace holds all parsing engines used by YARD.
|
89
|
+
# Currently only Ruby parsers are implemented with support planned for C.
|
117
90
|
module Parser
|
118
|
-
module Ruby
|
119
|
-
module Legacy
|
91
|
+
module Ruby # Ruby parsing components.
|
92
|
+
module Legacy # Handles Ruby parsing in Ruby 1.8.
|
120
93
|
autoload :RubyToken, __p('parser/ruby/legacy/ruby_lex')
|
121
94
|
autoload :Statement, __p('parser/ruby/legacy/statement')
|
122
95
|
autoload :StatementList, __p('parser/ruby/legacy/statement_list')
|
@@ -132,18 +105,18 @@ module YARD
|
|
132
105
|
autoload :UndocumentableError, __p('parser/source_parser')
|
133
106
|
end
|
134
107
|
|
135
|
-
module Rake
|
108
|
+
module Rake # Holds Rake tasks used by YARD
|
136
109
|
autoload :YardocTask, __p('rake/yardoc_task')
|
137
110
|
end
|
138
111
|
|
139
|
-
module Serializers
|
112
|
+
module Serializers # Namespace for components that serialize to various endpoints
|
140
113
|
autoload :Base, __p('serializers/base')
|
141
114
|
autoload :FileSystemSerializer, __p('serializers/file_system_serializer')
|
142
115
|
autoload :ProcessSerializer, __p('serializers/process_serializer')
|
143
116
|
autoload :StdoutSerializer, __p('serializers/stdout_serializer')
|
144
117
|
end
|
145
118
|
|
146
|
-
module Tags
|
119
|
+
module Tags # Namespace for Tag components
|
147
120
|
autoload :DefaultFactory, __p('tags/default_factory')
|
148
121
|
autoload :DefaultTag, __p('tags/default_tag')
|
149
122
|
autoload :Library, __p('tags/library')
|
@@ -154,10 +127,28 @@ module YARD
|
|
154
127
|
autoload :Tag, __p('tags/tag')
|
155
128
|
autoload :TagFormatError, __p('tags/tag_format_error')
|
156
129
|
end
|
130
|
+
|
131
|
+
module Templates # Namespace for templating system
|
132
|
+
module Helpers # Namespace for template helpers
|
133
|
+
autoload :BaseHelper, __p('templates/helpers/base_helper')
|
134
|
+
autoload :FilterHelper, __p('templates/helpers/filter_helper')
|
135
|
+
autoload :HtmlHelper, __p('templates/helpers/html_helper')
|
136
|
+
autoload :HtmlSyntaxHighlightHelper, __p('templates/helpers/html_syntax_highlight_helper' + (RUBY18 ? '18' : ''))
|
137
|
+
autoload :MarkupHelper, __p('templates/helpers/markup_helper')
|
138
|
+
autoload :MethodHelper, __p('templates/helpers/method_helper')
|
139
|
+
autoload :ModuleHelper, __p('templates/helpers/module_helper')
|
140
|
+
autoload :TextHelper, __p('templates/helpers/text_helper')
|
141
|
+
autoload :UMLHelper, __p('templates/helpers/uml_helper')
|
142
|
+
end
|
143
|
+
|
144
|
+
autoload :Engine, __p('templates/engine')
|
145
|
+
autoload :Template, __p('templates/template')
|
146
|
+
end
|
157
147
|
|
158
148
|
autoload :Docstring, __p('docstring')
|
159
149
|
autoload :Logger, __p('logging')
|
160
150
|
autoload :Registry, __p('registry')
|
151
|
+
autoload :Verifier, __p('verifier')
|
161
152
|
end
|
162
153
|
|
163
154
|
undef __p
|
data/lib/yard/cli/yard_graph.rb
CHANGED
@@ -2,29 +2,52 @@ require 'optparse'
|
|
2
2
|
|
3
3
|
module YARD
|
4
4
|
module CLI
|
5
|
+
# A command-line utility to generate Graphviz graphs from
|
6
|
+
# a set of objects
|
7
|
+
#
|
8
|
+
# @see YardGraph#run
|
5
9
|
class YardGraph
|
6
|
-
|
7
|
-
|
10
|
+
# The options parsed out of the commandline.
|
11
|
+
# Default options are:
|
12
|
+
# :format => :dot,
|
13
|
+
# :visibilities => [:public]
|
14
|
+
attr_reader :options
|
8
15
|
|
16
|
+
# The set of objects to include in the graph.
|
17
|
+
attr_reader :objects
|
18
|
+
|
19
|
+
# Helper method to run the utility on an instance.
|
20
|
+
# @see #run
|
9
21
|
def self.run(*args) new.run(*args) end
|
10
22
|
|
23
|
+
# Creates a new instance of the command-line utility
|
11
24
|
def initialize
|
25
|
+
@serializer = YARD::Serializers::StdoutSerializer.new
|
12
26
|
@options = SymbolHash[
|
13
|
-
:format => :dot,
|
14
|
-
:
|
15
|
-
:serializer => YARD::Serializers::StdoutSerializer.new,
|
16
|
-
:visibility => [:public]
|
27
|
+
:format => :dot,
|
28
|
+
:visibilities => [:public]
|
17
29
|
]
|
18
30
|
end
|
19
31
|
|
32
|
+
# Runs the command-line utility.
|
33
|
+
#
|
34
|
+
# @example
|
35
|
+
# grapher = YardGraph.new
|
36
|
+
# grapher.run('--private')
|
37
|
+
# @param [Array<String>] args each tokenized argument
|
20
38
|
def run(*args)
|
21
39
|
Registry.load
|
22
40
|
optparse(*args)
|
23
|
-
|
41
|
+
|
42
|
+
contents = objects.map {|o| o.format(options) }.join("\n")
|
43
|
+
Templates::Engine.render(:format => :dot, :type => :layout,
|
44
|
+
:serializer => @serializer, :contents => contents)
|
24
45
|
end
|
25
46
|
|
26
47
|
private
|
27
48
|
|
49
|
+
# Parses commandline options.
|
50
|
+
# @param [Array<String>] args each tokenized argument
|
28
51
|
def optparse(*args)
|
29
52
|
opts = OptionParser.new
|
30
53
|
|
@@ -44,27 +67,27 @@ module YARD
|
|
44
67
|
end
|
45
68
|
|
46
69
|
opts.on('--no-public', "Don't show public methods. (default shows public)") do
|
47
|
-
options[:
|
70
|
+
options[:visibilities].delete(:public)
|
48
71
|
end
|
49
72
|
|
50
73
|
opts.on('--protected', "Show or don't show protected methods. (default hides protected)") do
|
51
|
-
options[:
|
74
|
+
options[:visibilities].push(:protected)
|
52
75
|
end
|
53
76
|
|
54
77
|
opts.on('--private', "Show or don't show private methods. (default hides private)") do
|
55
|
-
options[:
|
78
|
+
options[:visibilities].push(:private)
|
56
79
|
end
|
57
80
|
|
58
81
|
opts.separator ""
|
59
82
|
opts.separator "Output options:"
|
60
83
|
|
61
84
|
opts.on('--dot [OPTIONS]', 'Send the results direclty to `dot` with optional arguments.') do |dotopts|
|
62
|
-
|
85
|
+
@serializer = Serializers::ProcessSerializer.new('dot ' + dotopts.to_s)
|
63
86
|
end
|
64
87
|
|
65
88
|
opts.on('-f', '--file [FILE]', 'Writes output to a file instead of stdout.') do |file|
|
66
|
-
|
67
|
-
|
89
|
+
@serializer = Serializers::FileSystemSerializer.new(:basepath => '.', :extension => nil)
|
90
|
+
@serializer.instance_eval "def serialized_path(object) #{file.inspect} end"
|
68
91
|
end
|
69
92
|
|
70
93
|
opts.separator ""
|
data/lib/yard/cli/yardoc.rb
CHANGED
@@ -3,31 +3,53 @@ require 'optparse'
|
|
3
3
|
module YARD
|
4
4
|
module CLI
|
5
5
|
class Yardoc
|
6
|
+
# The configuration filename to load extra options from
|
6
7
|
DEFAULT_YARDOPTS_FILE = ".yardopts"
|
7
8
|
|
8
|
-
|
9
|
-
|
9
|
+
# @return [Hash] the hash of options passed to the template.
|
10
|
+
# @see Templates::Engine#render
|
11
|
+
attr_reader :options
|
12
|
+
|
13
|
+
# @return [Array<String>] list of Ruby source files to process
|
14
|
+
attr_accessor :files
|
15
|
+
|
16
|
+
# @return [Boolean] whether to reparse the source files even if the
|
17
|
+
# .yardoc already exists.
|
18
|
+
attr_accessor :reload
|
19
|
+
|
20
|
+
# @return [Boolean] whether to generate output
|
21
|
+
attr_accessor :generate
|
22
|
+
|
23
|
+
# The options file name (defaults to {DEFAULT_YARDOPTS_FILE})
|
24
|
+
# @return [String] the filename to load extra options from
|
10
25
|
attr_accessor :options_file
|
11
26
|
|
27
|
+
# Helper method to create an instance and run the utility
|
28
|
+
# @see #run
|
12
29
|
def self.run(*args) new.run(*args) end
|
13
30
|
|
31
|
+
# Creates a new instance of the commandline utility
|
14
32
|
def initialize
|
15
33
|
@options = SymbolHash[
|
16
34
|
:format => :html,
|
17
35
|
:template => :default,
|
36
|
+
:markup => :rdoc,
|
18
37
|
:serializer => YARD::Serializers::FileSystemSerializer.new,
|
19
38
|
:files => [],
|
20
|
-
:
|
21
|
-
|
22
|
-
end
|
39
|
+
:visibilities => [:public],
|
40
|
+
:verifier => nil
|
23
41
|
]
|
24
42
|
@files = []
|
25
|
-
@visibilities = [:public]
|
26
43
|
@reload = true
|
27
44
|
@generate = true
|
28
45
|
@options_file = DEFAULT_YARDOPTS_FILE
|
29
46
|
end
|
30
47
|
|
48
|
+
# Runs the commandline utility, parsing arguments and generating
|
49
|
+
# output if set.
|
50
|
+
#
|
51
|
+
# @param [Array<String>] args the list of arguments
|
52
|
+
# @return [nil]
|
31
53
|
def run(*args)
|
32
54
|
args += support_rdoc_document_file!
|
33
55
|
optparse(*yardopts)
|
@@ -35,14 +57,22 @@ module YARD
|
|
35
57
|
Registry.load(files, reload)
|
36
58
|
|
37
59
|
if generate
|
38
|
-
|
60
|
+
Templates::Engine.generate(all_objects, options)
|
39
61
|
end
|
62
|
+
|
63
|
+
true
|
40
64
|
end
|
41
65
|
|
66
|
+
# The list of all objects to process. Override this method to change
|
67
|
+
# which objects YARD should generate documentation for.
|
68
|
+
#
|
69
|
+
# @return [Array<CodeObjects::Base>] a list of code objects to process
|
42
70
|
def all_objects
|
43
71
|
Registry.all(:root, :module, :class)
|
44
72
|
end
|
45
73
|
|
74
|
+
# Parses the .yardopts file for default yard options
|
75
|
+
# @return [nil]
|
46
76
|
def yardopts
|
47
77
|
IO.read(options_file).split(/\s+/)
|
48
78
|
rescue Errno::ENOENT
|
@@ -51,12 +81,16 @@ module YARD
|
|
51
81
|
|
52
82
|
private
|
53
83
|
|
84
|
+
# Reads a .document file in the directory to get source file globs
|
85
|
+
# @return [nil]
|
54
86
|
def support_rdoc_document_file!
|
55
87
|
IO.read(".document").split(/\s+/)
|
56
88
|
rescue Errno::ENOENT
|
57
89
|
[]
|
58
90
|
end
|
59
91
|
|
92
|
+
# Adds a set of extra documentation files to be processed
|
93
|
+
# @param [Array<String>] files the set of documentation files
|
60
94
|
def add_extra_files(*files)
|
61
95
|
files.map! {|f| f.include?("*") ? Dir.glob(f) : f }.flatten!
|
62
96
|
files.each do |file|
|
@@ -65,6 +99,15 @@ module YARD
|
|
65
99
|
end
|
66
100
|
end
|
67
101
|
|
102
|
+
# Parses the file arguments into Ruby files and extra files, which are
|
103
|
+
# separated by a '-' element.
|
104
|
+
#
|
105
|
+
# @example Parses a set of Ruby source files
|
106
|
+
# parse_files %w(file1 file2 file3)
|
107
|
+
# @example Parses a set of Ruby files with a separator and extra files
|
108
|
+
# parse_files %w(file1 file2 - extrafile1 extrafile2)
|
109
|
+
# @param [Array<String>] files the list of files to parse
|
110
|
+
# @return [nil]
|
68
111
|
def parse_files(*files)
|
69
112
|
self.files = []
|
70
113
|
seen_extra_files_marker = false
|
@@ -83,7 +126,16 @@ module YARD
|
|
83
126
|
end
|
84
127
|
end
|
85
128
|
|
129
|
+
# @param [Array<String>] expressions a list of query expressions to
|
130
|
+
# turn into a proc
|
131
|
+
def add_verifier(*expressions)
|
132
|
+
|
133
|
+
end
|
134
|
+
|
135
|
+
# Parses commandline options.
|
136
|
+
# @param [Array<String>] args each tokenized argument
|
86
137
|
def optparse(*args)
|
138
|
+
query_expressions = []
|
87
139
|
serialopts = SymbolHash.new
|
88
140
|
|
89
141
|
opts = OptionParser.new
|
@@ -131,21 +183,29 @@ module YARD
|
|
131
183
|
opts.separator "Output options:"
|
132
184
|
|
133
185
|
opts.on('--no-public', "Don't show public methods. (default shows public)") do
|
134
|
-
visibilities.delete(:public)
|
186
|
+
options[:visibilities].delete(:public)
|
135
187
|
end
|
136
188
|
|
137
189
|
opts.on('--protected', "Show or don't show protected methods. (default hides protected)") do
|
138
|
-
visibilities.push(:protected)
|
190
|
+
options[:visibilities].push(:protected)
|
139
191
|
end
|
140
192
|
|
141
193
|
opts.on('--private', "Show or don't show private methods. (default hides private)") do
|
142
|
-
visibilities.push(:private)
|
194
|
+
options[:visibilities].push(:private)
|
195
|
+
end
|
196
|
+
|
197
|
+
opts.on('--no-private', "Hide objects with @private tag") do
|
198
|
+
query_expressions << '!@private'
|
143
199
|
end
|
144
200
|
|
145
201
|
opts.on('--no-highlight', "Don't highlight code in docs as Ruby.") do
|
146
202
|
options[:no_highlight] = true
|
147
203
|
end
|
148
204
|
|
205
|
+
opts.on('--query QUERY', "Only show objects that match a specific query") do |query|
|
206
|
+
query_expressions << query.taint
|
207
|
+
end
|
208
|
+
|
149
209
|
opts.on('--title TITLE', 'Add a specific title to HTML documents') do |title|
|
150
210
|
options[:title] = title
|
151
211
|
end
|
@@ -182,7 +242,7 @@ module YARD
|
|
182
242
|
|
183
243
|
opts.on('-p', '--template-path PATH',
|
184
244
|
'The template path to look for templates in. (used with -t).') do |path|
|
185
|
-
YARD::
|
245
|
+
YARD::Templates::Engine.register_template_path(path)
|
186
246
|
end
|
187
247
|
|
188
248
|
opts.on('-f', '--format FORMAT',
|
@@ -208,8 +268,10 @@ module YARD
|
|
208
268
|
# Last minute modifications
|
209
269
|
parse_files(*args) unless args.empty?
|
210
270
|
self.files = ['lib/**/*.rb'] if self.files.empty?
|
211
|
-
|
271
|
+
options[:verifier] = Verifier.new(*query_expressions) unless query_expressions.empty?
|
272
|
+
options[:visibilities].uniq!
|
212
273
|
options[:serializer] ||= Serializers::FileSystemSerializer.new(serialopts)
|
274
|
+
options[:readme] ||= Dir.glob('README*').first
|
213
275
|
end
|
214
276
|
end
|
215
277
|
end
|