diff options
| author | Brice Figureau <brice-puppet@daysofwonder.com> | 2009-11-23 22:34:52 +0100 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2009-11-27 06:56:49 +1100 |
| commit | f5dd6c888a5e5011d2dac074373984604506ab12 (patch) | |
| tree | 3c16d159476c0b970ffa01cd68aaaa3ce479f210 /lib/puppet/util/rdoc | |
| parent | 4a06379f8770c164e42bcc410d874076c6e95f24 (diff) | |
| download | puppet-f5dd6c888a5e5011d2dac074373984604506ab12.tar.gz puppet-f5dd6c888a5e5011d2dac074373984604506ab12.tar.xz puppet-f5dd6c888a5e5011d2dac074373984604506ab12.zip | |
Fix #2831 - puppetdoc doesn't cope with regex node
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-puppet@daysofwonder.com>
Diffstat (limited to 'lib/puppet/util/rdoc')
| -rw-r--r-- | lib/puppet/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 bf2609fd6..58c0acadc 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 |
