On Jun 28, 2009, at 7:34 AM, Brice Figureau wrote:

>
> 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.

This works for scoped classes, but it doesn't actually work for  
subclasses that aren't in the same scope, right?

That is, doing:

class foo { }

class bar inherits foo {}

will break this again, right?

>
> Signed-off-by: Brice Figureau <[email protected]>
> ---
> 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 61316b4..1d4fa96 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)
> -- 
> 1.6.0.2
>
>
> >


-- 
Hollywood is a place where they'll pay you a thousand dollars for a
kiss and fifty cents for your soul. -- Marilyn Monroe
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to