diff options
author | Matt Robinson <matt@puppetlabs.com> | 2011-03-07 17:51:09 -0800 |
---|---|---|
committer | Max Martin <max@puppetlabs.com> | 2011-03-08 13:18:43 -0800 |
commit | 2a915725adf0ccefcc28653cbba2219925194594 (patch) | |
tree | 10df2000449d65e6b5954d2d8a1f5467fb10ad48 /lib/puppet | |
parent | 28ce355be0a16caa8e1cc0b6f531d2be070ca6f2 (diff) | |
download | puppet-2a915725adf0ccefcc28653cbba2219925194594.tar.gz puppet-2a915725adf0ccefcc28653cbba2219925194594.tar.xz puppet-2a915725adf0ccefcc28653cbba2219925194594.zip |
(#4798) Make rdoc work if moduledir & manifestdir overlap
Merging 2.6.next into next caused a regression; this commit fixes that
regression.
Paired-with:Max Martin <max@puppetlabs.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/util/rdoc.rb | 1 | ||||
-rw-r--r-- | lib/puppet/util/rdoc/parser.rb | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/puppet/util/rdoc.rb b/lib/puppet/util/rdoc.rb index 16d1fa15b..c00bc6f85 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 2b89baace..0f746e2ea 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 |