From 28ce355be0a16caa8e1cc0b6f531d2be070ca6f2 Mon Sep 17 00:00:00 2001 From: Matt Robinson Date: Mon, 7 Mar 2011 16:48:09 -0800 Subject: maint: Fix rdoc when documenting manifest files The structure of the AST has changed from 2.6.x to master, so the code to generate documentation from the AST had to change. Generating documentation for resources other than classes, nodes and defines is still broken, see ticket #6634 Paired-with: Daniel Pittman --- lib/puppet/util/rdoc.rb | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'lib/puppet') diff --git a/lib/puppet/util/rdoc.rb b/lib/puppet/util/rdoc.rb index bdac579d6..16d1fa15b 100644 --- a/lib/puppet/util/rdoc.rb +++ b/lib/puppet/util/rdoc.rb @@ -53,17 +53,10 @@ module Puppet::Util::RDoc # of a manifest def output(file, ast) astobj = [] - ast.nodes.each do |name, k| - astobj << k if k.file == file + ast.instantiate('').each do |resource_type| + astobj << resource_type if resource_type.file == file end - ast.hostclasses.each do |name,k| - astobj << k if k.file == file - end - - ast.definitions.each do |name, k| - astobj << k if k.file == file - end astobj.sort! {|a,b| a.line <=> b.line }.each do |k| output_astnode_doc(k) end @@ -89,4 +82,4 @@ module Puppet::Util::RDoc end end -end \ No newline at end of file +end -- cgit