[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 2.6.1rc1-141-gcdb2b90
Markus Roberts
Markus at reality.com
Mon Aug 16 12:48:02 UTC 2010
The following commit has been merged in the upstream branch:
commit 7ad7eb12fade4695abf08392e80ca57003353140
Author: Brice Figureau <brice-puppet at daysofwonder.com>
Date: Wed Jul 21 23:10:46 2010 +0200
Fix #4286 - rename puppetdoc global module <site> to __site__
< and > might be invalid or borderline chars to use for a file name
or an url.
This patch changes those characters to __.
Signed-off-by: Brice Figureau <brice-puppet at daysofwonder.com>
diff --git a/lib/puppet/util/rdoc/parser.rb b/lib/puppet/util/rdoc/parser.rb
index 573d176..63df38a 100644
--- a/lib/puppet/util/rdoc/parser.rb
+++ b/lib/puppet/util/rdoc/parser.rb
@@ -15,6 +15,8 @@ module RDoc
class Parser
extend ParserFactory
+ SITE = "__site__"
+
attr_accessor :ast, :input_file_name, :top_level
# parser registration into RDoc
@@ -74,7 +76,7 @@ class Parser
# split_module tries to find if +path+ belongs to the module path
# if it does, it returns the module name, otherwise if we are sure
- # it is part of the global manifest path, "<site>" is returned.
+ # it is part of the global manifest path, "__site__" is returned.
# And finally if this path couldn't be mapped anywhere, nil is returned.
def split_module(path)
# find a module
@@ -105,7 +107,7 @@ class Parser
end
# we are under a global manifests
Puppet.debug "rdoc: global manifests"
- "<site>"
+ SITE
end
# create documentation for the top level +container+
@@ -128,7 +130,7 @@ class Parser
Puppet.debug "rdoc: scanning for #{name}"
container.module_name = name
- container.global=true if name == "<site>"
+ container.global=true if name == SITE
@stats.num_modules += 1
container, name = get_class_or_module(container,name)
diff --git a/spec/unit/util/rdoc/parser_spec.rb b/spec/unit/util/rdoc/parser_spec.rb
index a9c8190..79195e6 100755
--- a/spec/unit/util/rdoc/parser_spec.rb
+++ b/spec/unit/util/rdoc/parser_spec.rb
@@ -85,8 +85,8 @@ describe RDoc::Parser do
@parser.scan_top_level(@topcontainer)
end
- it "should set the module as global if we parse the global manifests (ie <site> module)" do
- @parser.stubs(:split_module).returns("<site>")
+ it "should set the module as global if we parse the global manifests (ie __site__ module)" do
+ @parser.stubs(:split_module).returns(RDoc::Parser::SITE)
@parser.stubs(:parse_elements)
@topcontainer.expects(:global=).with(true)
@@ -131,7 +131,7 @@ describe RDoc::Parser do
it "should return <site> for manifests not under module path" do
File.stubs(:expand_path).returns("/path/to/manifests/init.pp")
File.stubs(:identical?).returns(false)
- @parser.split_module("/path/to/manifests/init.pp").should == "<site>"
+ @parser.split_module("/path/to/manifests/init.pp").should == RDoc::Parser::SITE
end
end
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list