From 48bc7d00ca87fa92cdde0b993529bba3827fa47e Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Fri, 11 Feb 2011 20:18:14 +0100 Subject: Fix #6280 - puppetdoc crashing on string interpolation The following manifest was crashing puppetdoc: class test { include "test::$operatingsystem" } Because the quoted string is "rendered" as a concat AST, which in turn ended being an array when entering RDoc. Signed-off-by: Brice Figureau --- lib/puppet/util/rdoc/parser.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/puppet/util/rdoc/parser.rb') diff --git a/lib/puppet/util/rdoc/parser.rb b/lib/puppet/util/rdoc/parser.rb index f9becede1..f59af64f9 100644 --- a/lib/puppet/util/rdoc/parser.rb +++ b/lib/puppet/util/rdoc/parser.rb @@ -157,8 +157,8 @@ class Parser if stmt.is_a?(Puppet::Parser::AST::Function) and ['include','require'].include?(stmt.name) stmt.arguments.each do |included| - Puppet.debug "found #{stmt.name}: #{included.value}" - container.send("add_#{stmt.name}",Include.new(included.value, stmt.doc)) + Puppet.debug "found #{stmt.name}: #{included}" + container.send("add_#{stmt.name}",Include.new(included.to_s, stmt.doc)) end end end -- cgit From cfa0c32fc5149464af97235a7bb458950d19cc82 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Fri, 11 Feb 2011 20:34:22 +0100 Subject: Fix #6281 - Make sure puppetdoc analyzes all files It can happen that when parsing a file puppet parses other manifests if they get imported (this is at least true for site.pp, even in ignoreimport=true). Thus those files are now "watched". But puppetdoc needs to analyze all files, and since 99c101 we are now checking if the file was already parsed to not reparse it again. If that was the case, though, we weren't analyzing the produced code. Thus it was possible to not produce documentation for the site.pp content. Signed-off-by: Brice Figureau --- lib/puppet/util/rdoc/parser.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/puppet/util/rdoc/parser.rb') diff --git a/lib/puppet/util/rdoc/parser.rb b/lib/puppet/util/rdoc/parser.rb index f59af64f9..ea7439ad7 100644 --- a/lib/puppet/util/rdoc/parser.rb +++ b/lib/puppet/util/rdoc/parser.rb @@ -41,8 +41,10 @@ class Parser @parser.file = @input_file_name @ast = @parser.parse end - scan_top_level(@top_level) + else + @ast = env.known_resource_types end + scan_top_level(@top_level) @top_level end -- cgit