From: Matt Robinson <[email protected]> Merging 2.6.next into next caused a regression; this commit fixes that regression.
Paired-with:Max Martin <[email protected]> Signed-off-by: Max Martin <[email protected]> --- Local-branch: ticket/next/4798-rdoc-fixes lib/puppet/util/rdoc.rb | 1 + lib/puppet/util/rdoc/parser.rb | 4 +++- spec/integration/application/doc_spec.rb | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/puppet/util/rdoc.rb b/lib/puppet/util/rdoc.rb index 16d1fa1..c00bc6f 100644 --- a/lib/puppet/util/rdoc.rb +++ b/lib/puppet/util/rdoc.rb @@ -31,6 +31,7 @@ module Puppet::Util::RDoc options << "--force-update" if Options::OptionList.options.any? { |o| o[0] == "--force-update" } options += [ "--charset", charset] if charset options += files + #TODO dedup file paths (not strict duplication sense, parents, children, etc # launch the documentation process r.document(options) diff --git a/lib/puppet/util/rdoc/parser.rb b/lib/puppet/util/rdoc/parser.rb index 2b89baa..0f746e2 100644 --- a/lib/puppet/util/rdoc/parser.rb +++ b/lib/puppet/util/rdoc/parser.rb @@ -34,17 +34,18 @@ class Parser # main entry point def scan environment = Puppet::Node::Environment.new + @known_resource_types = environment.known_resource_types unless environment.known_resource_types.watching_file?(@input_file_name) Puppet.info "rdoc: scanning #{@input_file_name}" if @input_file_name =~ /\.pp$/ @parser = Puppet::Parser::Parser.new(environment) @parser.file = @input_file_name - @known_resource_types = environment.known_resource_types @parser.parse.instantiate('').each do |type| @known_resource_types.add type end end end + scan_top_level(@top_level) @top_level end @@ -342,6 +343,7 @@ class Parser # that contains the documentation def parse_elements(container) Puppet.debug "rdoc: scanning manifest" + @known_resource_types.hostclasses.values.sort { |a,b| a.name <=> b.name }.each do |klass| name = klass.name if klass.file == @input_file_name diff --git a/spec/integration/application/doc_spec.rb b/spec/integration/application/doc_spec.rb index d94b304..f0b9d7d 100644 --- a/spec/integration/application/doc_spec.rb +++ b/spec/integration/application/doc_spec.rb @@ -7,7 +7,6 @@ describe Puppet::Application::Doc do include PuppetSpec::Files it "should not generate an error when module dir overlaps parent of site.pp (#4798)" do - pending "need to fix as part of fixing Brice's rdoc patch" begin # Note: the directory structure below is more complex than it # needs to be, but it's representative of the directory structure -- 1.7.4 -- 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.
