summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/files.rb
diff options
context:
space:
mode:
authorDavid Schmitt <david@dasz.at>2010-05-17 16:11:20 +0200
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commitf054d5b6abe2de3810203b13c8f263d9a23f0d50 (patch)
tree19a76a255946261c40a2d9b64b9096d73dd83d9c /lib/puppet/parser/files.rb
parent54c453853ddb1648af14b42dca6f827c5cb8e007 (diff)
downloadpuppet-f054d5b6abe2de3810203b13c8f263d9a23f0d50.tar.gz
puppet-f054d5b6abe2de3810203b13c8f263d9a23f0d50.tar.xz
puppet-f054d5b6abe2de3810203b13c8f263d9a23f0d50.zip
Make specs work on win32
lib/: * Fix Puppet::Parser::Files * Fix Puppet::Util::Settings spec/: * unit/application/kick.rb: only run on posix * unit/application.rb * unit/parser/compiler.rb * unit/parser/files.rb * unit/resource.rb * unit/resource/catalog.rb * unit/resource/type_collection.rb * unit/transaction.rb * unit/type/tidy.rb * unit/util/settings.rb * unit/util/settings/file_setting.rb * unit/application.rb
Diffstat (limited to 'lib/puppet/parser/files.rb')
-rw-r--r--lib/puppet/parser/files.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/puppet/parser/files.rb b/lib/puppet/parser/files.rb
index 3442e11a6..1ff5552a0 100644
--- a/lib/puppet/parser/files.rb
+++ b/lib/puppet/parser/files.rb
@@ -38,7 +38,7 @@ module Puppet::Parser::Files
# In all cases, an absolute path is returned, which does not
# necessarily refer to an existing file
def find_template(template, environment = nil)
- if template =~ /^#{File::SEPARATOR}/
+ if template == File.expand_path(template)
return template
end
@@ -76,7 +76,7 @@ module Puppet::Parser::Files
# Return an array of paths by splitting the +templatedir+ config
# parameter.
def templatepath(environment = nil)
- dirs = Puppet.settings.value(:templatedir, environment).split(":")
+ dirs = Puppet.settings.value(:templatedir, environment).split(File::PATH_SEPARATOR)
dirs.select do |p|
File::directory?(p)
end
@@ -86,7 +86,7 @@ module Puppet::Parser::Files
# nil if the path is empty or absolute (starts with a /).
# This method can return nil & anyone calling it needs to handle that.
def split_file_path(path)
- path.split(File::SEPARATOR, 2) unless path =~ /^(#{File::SEPARATOR}|$)/
+ path.split(File::SEPARATOR, 2) unless path == "" or path == File.expand_path(path)
end
end