summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util/rdoc/parser.rb
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2009-11-04 20:21:16 +0100
committerBrice Figureau <brice-puppet@daysofwonder.com>2009-11-04 20:21:16 +0100
commitb832d815c3211f22945cbce56dfbf61116f7a792 (patch)
tree347076d81c5c5bd176b24a3bec4f83b452c80a63 /lib/puppet/util/rdoc/parser.rb
parentb1deb89bae67f7d71ffe412ce4fd8e99c6e1c159 (diff)
downloadpuppet-b832d815c3211f22945cbce56dfbf61116f7a792.tar.gz
puppet-b832d815c3211f22945cbce56dfbf61116f7a792.tar.xz
puppet-b832d815c3211f22945cbce56dfbf61116f7a792.zip
Fix #2784 - puppetdoc/rdoc didn't parse mono-instruction class content
class klass { include a, b, c } wasn't producing any rdoc documentation. We were thinking code was always embedded in an array which is not the case for mono-instruction code. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'lib/puppet/util/rdoc/parser.rb')
-rw-r--r--lib/puppet/util/rdoc/parser.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/puppet/util/rdoc/parser.rb b/lib/puppet/util/rdoc/parser.rb
index aa34335cc..d7e1c30fa 100644
--- a/lib/puppet/util/rdoc/parser.rb
+++ b/lib/puppet/util/rdoc/parser.rb
@@ -148,6 +148,7 @@ class Parser
# create documentation for include statements we can find in +code+
# and associate it with +container+
def scan_for_include_or_require(container, code)
+ code = [code] unless code.is_a?(Array)
code.each do |stmt|
scan_for_include_or_require(container,stmt.children) if stmt.is_a?(Puppet::Parser::AST::ASTArray)
@@ -163,6 +164,7 @@ class Parser
# create documentation for global variables assignements we can find in +code+
# and associate it with +container+
def scan_for_vardef(container, code)
+ code = [code] unless code.is_a?(Array)
code.each do |stmt|
scan_for_vardef(container,stmt.children) if stmt.is_a?(Puppet::Parser::AST::ASTArray)
@@ -176,6 +178,7 @@ class Parser
# create documentation for resources we can find in +code+
# and associate it with +container+
def scan_for_resource(container, code)
+ code = [code] unless code.is_a?(Array)
code.each do |stmt|
scan_for_resource(container,stmt.children) if stmt.is_a?(Puppet::Parser::AST::ASTArray)