Merge pull request #42 from iankronquist/forgot-defined-types

Forgot defined types
This commit is contained in:
Hailee Kenney 2015-07-28 13:35:00 -07:00
commit e9167b11e6
2 changed files with 18 additions and 1 deletions

View File

@ -8,6 +8,23 @@ class PuppetX::PuppetLabs::Strings::YARD::Handlers::DefinedTypeHandler < PuppetX
param_tuple << ( a[1].nil? ? nil : a[1].source )
end
end
tp = Puppet::Pops::Types::TypeParser.new
param_type_info = {}
statement.pops_obj.parameters.each do |pop_param|
# If the parameter's type expression is nil, default to Any
if pop_param.type_expr == nil
param_type_info[pop_param.name] = Puppet::Pops::Types::TypeFactory.any()
else
begin
param_type_info[pop_param.name] = tp.interpret_any(pop_param.type_expr)
rescue Puppet::ParseError => e
# If the type could not be interpreted insert a prominent warning
param_type_info[pop_param.name] = "Type Error: #{e.message}"
end
end
end
obj.type_info = [param_type_info]
register obj
end

View File

@ -60,7 +60,7 @@ class HTMLHelper
end
# Give up. It can probably be anything.
elsif !param[:puppet_3_func]
result << "(<tt>Unkown</tt>)"
result << "(<tt>Unknown</tt>)"
end
result << "</span>"