The problem is that regex node contains '/' which is a directory
separator on unix.
Since puppetdoc writes a file for each node this was creating empty
directories and documentation for such node couldn't be stored.
This patch removes the slashes in the node names.
Signed-off-by: Brice Figureau <
brice-...@daysofwonder.com>
---
.../util/rdoc/generators/puppet_generator.rb | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/puppet/util/rdoc/generators/puppet_generator.rb b/lib/puppet/util/rdoc/generators/puppet_generator.rb
index bf2609f..58c0aca 100644
--- a/lib/puppet/util/rdoc/generators/puppet_generator.rb
+++ b/lib/puppet/util/rdoc/generators/puppet_generator.rb
@@ -1,5 +1,7 @@
require 'rdoc/generators/html_generator'
require 'puppet/util/rdoc/code_objects'
+require 'digest/md5'
+
module Generators
# This module holds all the classes needed to generate the HTML documentation
@@ -335,7 +337,7 @@ module Generators
resources.each do |r|
res << {
"name" => CGI.escapeHTML(
r.name),
- "aref" => "#{path_prefix}\##{r.aref}"
+ "aref" => CGI.escape(path_prefix)+"\#"+CGI.escape(r.aref)
}
end
res
@@ -414,7 +416,7 @@ module Generators
if path['<<']
path.gsub!(/<<\s*(\w*)/) { "from-#$1" }
end
- File.join(prefix, path.split("::")) + ".html"
+ File.join(prefix, path.split("::").collect { |p| Digest::MD5.hexdigest(p) }) + ".html"
end
def parent_name
@@ -508,7 +510,7 @@ module Generators
h_name = CGI.escapeHTML(name)
@values["classmod"] = "Node"
- @values["title"] = "#{@values['classmod']}: #{h_name}"
+ @values["title"] = CGI.escapeHTML("#{@values['classmod']}: #{h_name}")
c = @context
c = c.parent while c and !c.diagram
--
1.6.5.2