Selinux modules files also ends in ".pp".
Puppetdoc tries to parse them as if they are regular puppet files and
then fails.
This patch makes sure puppetdoc tells RDoc to exclude parsing .pp
files in the modules files section.

Signed-off-by: Brice Figureau <[email protected]>
---
 lib/puppet/util/rdoc.rb |    1 +
 spec/unit/util/rdoc.rb  |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/lib/puppet/util/rdoc.rb b/lib/puppet/util/rdoc.rb
index 4edbf06..fc4e2c6 100644
--- a/lib/puppet/util/rdoc.rb
+++ b/lib/puppet/util/rdoc.rb
@@ -23,6 +23,7 @@ module Puppet::Util::RDoc
             options = [ "--fmt", "puppet",
                         "--quiet",
                         "--force-update",
+                        "--exclude", "/modules/[^/]*/files/.*\.pp$",
                         "--op", outputdir ]
 
             options += files
diff --git a/spec/unit/util/rdoc.rb b/spec/unit/util/rdoc.rb
index eeaaa32..25c94a1 100755
--- a/spec/unit/util/rdoc.rb
+++ b/spec/unit/util/rdoc.rb
@@ -49,6 +49,12 @@ describe Puppet::Util::RDoc do
             Puppet::Util::RDoc.rdoc("myoutputdir", [])
         end
 
+        it "should tell RDoc to exclude .pp files under any 
modules/<mod>/files section" do
+            @rdoc.expects(:document).with { |args| args.include?("--exclude") 
and args.include?("/modules/[^/]*/files/.*\.pp$") }
+
+            Puppet::Util::RDoc.rdoc("myoutputdir", [])
+        end
+
         it "should give all the source directories to RDoc" do
             @rdoc.expects(:document).with { |args| args.include?("sourcedir") }
 
-- 
1.6.5.2

--

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.


Reply via email to