class Ohai::Config

Public Class Methods

platform_specific_path(path) click to toggle source

from chef/config.rb, should maybe be moved to mixlib-config?

# File lib/ohai/config.rb, line 26
def self.platform_specific_path(path)
  if RUBY_PLATFORM =~ /mswin|mingw|windows/
    # turns /etc/chef/client.rb into C:/chef/client.rb
    path = File.join(ENV['SYSTEMDRIVE'], path.split('/')[2..-1])
    # ensure all forward slashes are backslashes
    path.gsub!(File::SEPARATOR, (File::ALT_SEPARATOR || '\'))
  end
  path
end