Skip to content

Commit

Permalink
(PDOC-53) Handle directives with no types
Browse files Browse the repository at this point in the history
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, ...]
  • Loading branch information
iankronquist committed Sep 15, 2015
1 parent 3a2f700 commit 7f4b81e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/puppet_x/puppetlabs/strings/yard/tags/directives.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
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

0 comments on commit 7f4b81e

Please sign in to comment.