From f054d5b6abe2de3810203b13c8f263d9a23f0d50 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Mon, 17 May 2010 16:11:20 +0200 Subject: 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 --- lib/puppet/parser/files.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/puppet/parser') 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 -- cgit