Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception in YARD::Handlers::Ruby::MethodHandler #614

Closed
ssimeonov opened this issue Oct 20, 2012 · 1 comment
Closed

Unhandled exception in YARD::Handlers::Ruby::MethodHandler #614

ssimeonov opened this issue Oct 20, 2012 · 1 comment

Comments

@ssimeonov
Copy link

When processing the included Ruby file, YARD generates the following output:

2047[SPX/internal(ss_yard *)]$ yardoc
[error]: Unhandled exception in YARD::Handlers::Ruby::MethodHandler:
[error]:   in `doc/pub_sub.rb`:11:

    11: def notify(resource, opts = {})

[error]: NoMethodError: undefined method `length' for nil:NilClass
[error]: Stack trace:
    /Users/sim/.rvm/gems/ruby-1.9.2-p290@shopximity/gems/yard-0.8.2.1/lib/yard/tags/default_factory.rb:139:in `extract_types_and_name_from_text_unstripped'
    /Users/sim/.rvm/gems/ruby-1.9.2-p290@shopximity/gems/yard-0.8.2.1/lib/yard/tags/default_factory.rb:126:in `extract_types_and_name_from_text'
    /Users/sim/.rvm/gems/ruby-1.9.2-p290@shopximity/gems/yard-0.8.2.1/lib/yard/tags/default_factory.rb:76:in `parse_tag_with_types_name_and_default'
    /Users/sim/.rvm/gems/ruby-1.9.2-p290@shopximity/gems/yard-0.8.2.1/lib/yard/tags/default_factory.rb:88:in `parse_tag_with_options'
    /Users/sim/.rvm/gems/ruby-1.9.2-p290@shopximity/gems/yard-0.8.2.1/lib/yard/tags/library.rb:237:in `send_to_factory'
    /Users/sim/.rvm/gems/ruby-1.9.2-p290@shopximity/gems/yard-0.8.2.1/lib/yard/tags/library.rb:172:in `option_tag'

Files:           1
Modules:         1 (    1 undocumented)
Classes:         0 (    0 undocumented)
Constants:       0 (    0 undocumented)
Methods:         2 (    1 undocumented)
 33.33% documented

The Ruby code that causes this is:

module PubSub

  module_function

  # Publishes a notification
  #
  # @param [String] resource the name of the resource
  # @param [Hash] opts the options to create a message with.
  # @option opts [String, Symbol] :action the action to notify about
  # @option opts [Object] :payload (nil) The notification payload
  def notify(resource, opts = {})
  end

end

Removing either the opts documentation or module_function eliminates the problem.

@lsegal
Copy link
Owner

lsegal commented Oct 22, 2012

Fixed by #563, upgrading to 0.8.3 will fix this issue.

@lsegal lsegal closed this as completed Oct 22, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants