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

Already on GitHub? Sign in to your account

@option tags break on module_functions #563

ConradIrwin opened this Issue Jun 26, 2012 · 0 comments


None yet
2 participants

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/yard@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- `extract_types_and_name_from_text_unstripped'

@lsegal lsegal closed this in f374d2b Jul 14, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment