Closed ksss closed 9 months ago
Applying the @option tag to non-method code results in an error during documentation generation.
@option
$ cat t.rb # @option [String] foo bar module Foo end $ bundle exec yardoc t.rb [error]: Exception occurred while generating 'Foo.html' [error]: NoMethodError: undefined method `parameters' for #<yardoc module Foo> [error]: Stack trace: /Users/yuki.kurihara/src/github.com/ksss/yard/lib/yard/code_objects/base.rb:379:in `method_missing' /Users/yuki.kurihara/src/github.com/ksss/yard/templates/default/tags/html/option.erb:4:in `_erb_cache_33' /Users/yuki.kurihara/src/github.com/ksss/yard/lib/yard/templates/template.rb:289:in `erb' /Users/yuki.kurihara/src/github.com/ksss/yard/lib/yard/templates/template.rb:371:in `render_section' /Users/yuki.kurihara/src/github.com/ksss/yard/lib/yard/templates/template.rb:261:in `block (2 levels) in run' /Users/yuki.kurihara/src/github.com/ksss/yard/lib/yard/templates/template.rb:258:in `each' Files: 1 Modules: 1 ( 0 undocumented) Classes: 0 ( 0 undocumented) Constants: 0 ( 0 undocumented) Attributes: 0 ( 0 undocumented) Methods: 0 ( 0 undocumented) 100.00% documented
I have fixed it to prevent the error from occurring.
It might be acceptable to log a warning message, but for now, I've adjusted it to match the current behavior of the @param tag, which displays nothing.
@param
bundle exec rake
Appreciate the changes and thank you for this fix!
Description
Applying the
@option
tag to non-method code results in an error during documentation generation.I have fixed it to prevent the error from occurring.
It might be acceptable to log a warning message, but for now, I've adjusted it to match the current behavior of the
@param
tag, which displays nothing.Completed Tasks
bundle exec rake
locally (if code is attached to PR).