summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/ast/function.rb
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2009-07-18 13:08:57 +0200
committerJames Turnbull <james@lovedthanlost.net>2009-07-25 20:13:58 +1000
commite3ee594fdfa0e7a6d9de26c4307e217de866f462 (patch)
tree315177df89205b1747fb506edc543175ebf032f0 /lib/puppet/parser/ast/function.rb
parentb3b76dffdd9cd8ed5c3d0230624bf05015bec5b8 (diff)
downloadpuppet-e3ee594fdfa0e7a6d9de26c4307e217de866f462.tar.gz
puppet-e3ee594fdfa0e7a6d9de26c4307e217de866f462.tar.xz
puppet-e3ee594fdfa0e7a6d9de26c4307e217de866f462.zip
Fix #2422 & #2433 - make sure puppetdoc transform AST::Leaf boolean correctly
AST nodes don't have a valid to_s that is producing a correct representation of said node. This patch adds some of the AST node to_s to produce correct values that can be used verbatim by puppetdoc to render the documentation. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'lib/puppet/parser/ast/function.rb')
-rw-r--r--lib/puppet/parser/ast/function.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/puppet/parser/ast/function.rb b/lib/puppet/parser/ast/function.rb
index 2f768ebdb..4c3a5dc05 100644
--- a/lib/puppet/parser/ast/function.rb
+++ b/lib/puppet/parser/ast/function.rb
@@ -51,5 +51,10 @@ class Puppet::Parser::AST
@fname = Puppet::Parser::Functions.function(@name)
# Lastly, check the parity
end
+
+ def to_s
+ args = arguments.is_a?(ASTArray) ? arguments.to_s.gsub(/\[(.*)\]/,'\1') : arguments
+ "#{name}(#{args})"
+ end
end
end