(PDOC-52) Register docstring after object

In a Puppet type if the user documents a parameter with the directive, then
Yard will read the parameter and think there is an empty docstring there. This
will overwrite the docstring we extracted.
The fix is simple -- overwrite our docstring with theirs, if our docstring
exists at all.
This commit is contained in:
Ian Kronquist 2015-09-14 15:14:31 -07:00
parent 782fee5d0b
commit d2c178b59c
1 changed files with 5 additions and 2 deletions

View File

@ -138,9 +138,12 @@ class PuppetX::PuppetLabs::Strings::YARD::Handlers::PuppetTypeHandler < YARD::Ha
obj.property_details = property_details
obj.features = features
register_docstring(obj, docstring, nil)
register obj
# Register docstring after the object. If the object already has a
# docstring, or more likely has parameters documented with the type
# directive and an empty docstring, we want to override it with the
# docstring we found, assuming we found one.
register_docstring(obj, docstring, nil) if docstring
end