Class: Komonzu::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/komonzu/config.rb

Class Method Summary collapse

Class Method Details

.platform_specific_path(path) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/komonzu/config.rb', line 4

def self.platform_specific_path(path)
	if RUBY_PLATFORM =~ /mswin|mingw|windows/
		# Turns /etc/chef/client.rb into C:/chef/client.rb (and then changes / to \)
		path = File.join(ENV['SYSTEMDRIVE'], path.split('/')[2..-1])
		path.gsub!(File::SEPARATOR, (File::ALT_SEPARATOR || '\\'))
	end
	path
end