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

@option tags break on module_functions #563

Closed
ConradIrwin opened this issue Jun 26, 2012 · 0 comments
Closed

@option tags break on module_functions #563

ConradIrwin opened this issue Jun 26, 2012 · 0 comments
Labels
Milestone

Comments

@ConradIrwin
Copy link

I think there are two problems here (first reported at ConradIrwin/jist#2).

Most importantly is that when CodeObjects::Base#copy_to is used to clone the module_function method object; DocString#to_raw fails to recreate @option tags correctly:

pry> YARD::Docstring.new("@option options [Foo] :bar").to_raw
=> "@option options"

I've attempted to fix this at ConradIrwin@e5cf1c3. I'm happy to send a pull request if that approach makes sense to you; otherwise it might be better to invent a less fragile way to clone CodeObjects.

The second bug? is that this causes YARD to raise an exception (though that's perhaps understandable).

pry> YARD::Docstring.new("@option options").to_raw
NoMethodError: undefined method `length' for nil:NilClass
from /Users/cirwin/.rvm/gems/ruby-1.9.3-p125/gems/yard-0.8.2.1/lib/yard/tags/default_factory.rb:139:in `extract_types_and_name_from_text_unstripped'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants