From 869ec273a085c1fa28da14bfd627ffc24af87a07 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Sat, 27 Jun 2009 12:21:30 +0200 Subject: Fix #2366 - puppetdoc was parsing classes in the wrong order It could happend that we were generating doc for subclasses before classes, in which case we were forgotting some parent class instance and recreating them. We ended up generating doc for some classes multiple times, from which some were missing documentation. The fix is to sort the parsed classes alphabetically, which auto- matically puts enclosing class before enclosed classes. Signed-off-by: Brice Figureau --- lib/puppet/util/rdoc/parser.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/puppet/util/rdoc/parser.rb b/lib/puppet/util/rdoc/parser.rb index 61316b469..1d4fa966a 100644 --- a/lib/puppet/util/rdoc/parser.rb +++ b/lib/puppet/util/rdoc/parser.rb @@ -281,7 +281,8 @@ class Parser # that contains the documentation def parse_elements(container) Puppet.debug "rdoc: scanning manifest" - @ast[:classes].each do |name, klass| + @ast[:classes].values.sort { |a,b| a.classname <=> b.classname }.each do |klass| + name = klass.classname if klass.file == @input_file_name unless name.empty? document_class(name,klass,container) -- cgit