Parent

Class/Module Index [+]

Quicksearch

Chef::Config

Public Class Methods

inspect() click to toggle source
# File lib/chef/config.rb, line 46
def self.inspect
  configuration.inspect
end
manage_secret_key() click to toggle source

Manages the chef secret session key

Returns

<newkey>

A new or retrieved session key

# File lib/chef/config.rb, line 33
def self.manage_secret_key
  newkey = nil
  if Chef::FileCache.has_key?("chef_server_cookie_id")
    newkey = Chef::FileCache.load("chef_server_cookie_id")
  else
    chars = ("a".."z").to_a + ("A".."Z").to_a + ("0".."9").to_a
    newkey = ""
    40.times { |i| newkey << chars[rand(chars.size-1)] }
    Chef::FileCache.store("chef_server_cookie_id", newkey)
  end
  newkey
end
platform_specific_path(path) click to toggle source
# File lib/chef/config.rb, line 50
def self.platform_specific_path(path)
  #10.times { puts "* " * 40}
  #pp caller

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.