From 60008def93428f0a7a62523c91ac9f4339bf5af3 Mon Sep 17 00:00:00 2001 From: Ian Kronquist Date: Mon, 3 Aug 2015 13:40:06 -0700 Subject: [PATCH] (PDOC-21) Check mismatched types in defined types --- .../strings/yard/templates/default/definedtype/setup.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/setup.rb b/lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/setup.rb index b11f1fa95..48f287796 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/setup.rb +++ b/lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/setup.rb @@ -8,6 +8,12 @@ def init @template_helper = TemplateHelper.new @html_helper = HTMLHelper.new + @template_helper.check_parameters_match_docs object + params = object.parameters.map { |param| param.first } + param_tags = object.tags.find_all{ |tag| tag.tag_name == "param"} + param_details = @template_helper.extract_param_details(params, param_tags) unless params.nil? + @template_helper.check_types_match_docs object, param_details + end def parameter_details @@ -19,7 +25,6 @@ def parameter_details @param_details = [] @param_details = @template_helper.extract_param_details(params, param_tags, true) - @template_helper.check_parameters_match_docs object erb(:parameter_details) end