(PDOC-53) Handle directives with no types

Parameter directives with no types will have `tag.type` set to nil. We cannot
append nil to an array, so instead, place it in the array and flatten the
array. If the property is empty the second entry in the array will be nil, as
we expect. If the `tag.type` is an array of types we will have and array with
the form:
	[tag.text, type1, type2, type3, ...]
This commit is contained in:
Ian Kronquist 2015-09-14 15:17:23 -07:00
parent 3a2f70026e
commit 7f4b81e77b
1 changed files with 1 additions and 1 deletions

View File

@ -3,7 +3,7 @@ require 'puppet_x/puppetlabs/strings/yard/core_ext/yard'
class PuppetX::PuppetLabs::Strings::YARD::Tags::PuppetTypeParameterDirective < YARD::Tags::Directive
def call
return if object.nil?
object.parameters << ([tag.text] + tag.types)
object.parameters << ([tag.text, tag.types].flatten)
object.parameter_details << {:name => tag.name, :desc => tag.text, :exists? => true, :puppet_type => true}
end
end