diff options
author | Brice Figureau <brice-puppet@daysofwonder.com> | 2009-07-29 21:21:25 +0200 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-07-30 07:48:26 +1000 |
commit | 0ca9b5322117879cf930c88a0473558d9e437ece (patch) | |
tree | 8ba01e69374cb0fad0ab6f8fc76f826e909b9437 /lib/puppet/util/rdoc/parser.rb | |
parent | 18b5d614462e2af8faca92fa1881f4968487d3e7 (diff) | |
download | puppet-0ca9b5322117879cf930c88a0473558d9e437ece.tar.gz puppet-0ca9b5322117879cf930c88a0473558d9e437ece.tar.xz puppet-0ca9b5322117879cf930c88a0473558d9e437ece.zip |
Fix #2459 - puppetdoc added namespace classes as RDoc modules instead of classes
Puppetdoc while parsing a class name creates intermediate RDoc classes
to form a hierarchy. Due to a coding error, those intermediate classes
were created as RDoc modules.
Later, when puppetdoc was parsing the definition of one of this class,
it wasn't finding it in RDoc list of classes (since it was recorded
as a module).
Puppetdoc was then creating documentation for two objects of the same
name.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'lib/puppet/util/rdoc/parser.rb')
-rw-r--r-- | lib/puppet/util/rdoc/parser.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/puppet/util/rdoc/parser.rb b/lib/puppet/util/rdoc/parser.rb index 80b3932ff..554f8cb00 100644 --- a/lib/puppet/util/rdoc/parser.rb +++ b/lib/puppet/util/rdoc/parser.rb @@ -68,7 +68,7 @@ class Parser prev_container = container container = find_object_named(container, name) unless container - container = prev_container.add_module(PuppetClass, name) + container = prev_container.add_class(PuppetClass, name, nil) end end return [container, final_name] @@ -210,6 +210,10 @@ class Parser comment = klass.doc look_for_directives_in(container, comment) unless comment.empty? cls = container.add_class(PuppetClass, name, superclass) + # it is possible we already encountered this class, while parsing some namespaces + # from other classes of other files. But at that time we couldn't know this class superclass + # so, now we know it and force it. + cls.superclass = superclass cls.record_location(@top_level) # scan class code for include |