diff options
author | Brice Figureau <brice-puppet@daysofwonder.com> | 2009-06-27 12:21:30 +0200 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-07-10 10:57:37 +1000 |
commit | 869ec273a085c1fa28da14bfd627ffc24af87a07 (patch) | |
tree | f9588bf87e8cef310251e140bd6aa7eff7d28ae5 /lib | |
parent | 4c659b768f9ab9f0468245af789b3c817f5c4be4 (diff) | |
download | puppet-869ec273a085c1fa28da14bfd627ffc24af87a07.tar.gz puppet-869ec273a085c1fa28da14bfd627ffc24af87a07.tar.xz puppet-869ec273a085c1fa28da14bfd627ffc24af87a07.zip |
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 <brice-puppet@daysofwonder.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/util/rdoc/parser.rb | 3 |
1 files changed, 2 insertions, 1 deletions
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) |