summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2011-03-07 17:51:09 -0800
committerMax Martin <max@puppetlabs.com>2011-03-08 13:18:43 -0800
commit2a915725adf0ccefcc28653cbba2219925194594 (patch)
tree10df2000449d65e6b5954d2d8a1f5467fb10ad48
parent28ce355be0a16caa8e1cc0b6f531d2be070ca6f2 (diff)
downloadpuppet-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>
-rw-r--r--lib/puppet/util/rdoc.rb1
-rw-r--r--lib/puppet/util/rdoc/parser.rb4
-rw-r--r--spec/integration/application/doc_spec.rb1
3 files changed, 4 insertions, 2 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
diff --git a/spec/integration/application/doc_spec.rb b/spec/integration/application/doc_spec.rb
index d94b3043b..f0b9d7db0 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