Skip to content

Commit

Permalink
Merge pull request #4 from alexjfisher/issue_3
Browse files Browse the repository at this point in the history
Fix converting functions with no docs
  • Loading branch information
binford2k committed Dec 6, 2019
2 parents 76d6cfb + b5f1f0f commit 68227eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/pfu/parser.rb
Expand Up @@ -55,7 +55,7 @@ def self.parse(path)
header = lines[0...(lines.index { |l| l =~ /Puppet::Parser::Functions/ })].join("\n")
args = lines[lineno-1].match(/\|\s*(\w+)\s*\|/)[1]

opts[:doc].gsub!("\n", "\n#")
opts[:doc].gsub!("\n", "\n#") unless opts[:doc].nil?

opts[:name] = funcname.to_sym
opts[:header] = header
Expand Down
2 changes: 1 addition & 1 deletion templates/function.erb
Expand Up @@ -10,7 +10,7 @@
# ---- original file header ----
#
# @summary
# <%= opts[:doc] %>
# <%= opts[:doc] || 'Summarise what the function does here' %>
#
Puppet::Functions.create_function(:'<%= opts[:fullname] %>') do
# @param <%= opts[:args] %>
Expand Down

0 comments on commit 68227eb

Please sign in to comment.