I've verified this works and fixes the error you get if there's non puppet files. Brice, any chance you could write a test to motivate this change? I know the puppet_generator.rb doesn't have any tests, but I see you wrote the original code too, so hopefully it won't be that difficult for you.
Thanks Matt On Sat, Oct 16, 2010 at 8:48 AM, Brice Figureau <[email protected]> wrote: > RDoc has some standard parsers for .c,.cc or fortran files (don't ask why). > Unfortunately our html generator doesn't support the data structures > generated by those parsers and we were bombing on unknown methods. > This patch makes sure we generate html only for our own top level objects. > > Signed-off-by: Brice Figureau <[email protected]> > --- > .../util/rdoc/generators/puppet_generator.rb | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/lib/puppet/util/rdoc/generators/puppet_generator.rb > b/lib/puppet/util/rdoc/generators/puppet_generator.rb > index 9caeacd..e6bbb2e 100644 > --- a/lib/puppet/util/rdoc/generators/puppet_generator.rb > +++ b/lib/puppet/util/rdoc/generators/puppet_generator.rb > @@ -88,6 +88,12 @@ module Generators > @modules = {} > @allclasses = {} > > + # remove unknown toplevels > + # it can happen that RDoc triggers a different parser for some files > (ie .c, .cc or .h) > + # in this case RDoc generates a RDoc::TopLevel which we do not support > in this generator > + # So let's make sure we don't generate html for those. > + �...@toplevels = @toplevels.select { |tl| tl.is_a? RDoc::PuppetTopLevel > } > + > # build the modules, classes and per modules classes and define list > @toplevels.each do |toplevel| > next unless toplevel.document_self > -- > 1.7.2.1 > > -- > 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. > > -- 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.
