# File lib/chef/config.rb, line 61 def self.add_formatter(name, file_path=nil) formatters << [name, file_path] end
# File lib/chef/config.rb, line 65 def self.formatters @formatters ||= [] end
# File lib/chef/config.rb, line 46 def self.inspect configuration.inspect end
Manages the chef secret session key
<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
# File lib/chef/config.rb, line 50 def self.platform_specific_path(path) 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
Generated with the Darkfish Rdoc Generator 2.