class Ridley::Chef::Config
Public Class Methods
from_file(file)
click to toggle source
Load from a file
# File lib/ridley/chef/config.rb, line 34 def self.from_file(file) new(file) end
new(path, options = {})
click to toggle source
Create a new Chef
Config
object.
@param [#to_s] path
the path to the configuration file
@param [Hash] options
# File lib/ridley/chef/config.rb, line 12 def initialize(path, options = {}) ChefConfig::WorkstationConfigLoader.new(path).load ChefConfig::Config.merge!(options) ChefConfig::Config.export_proxies # Set proxy settings as environment variables end
Public Instance Methods
cookbook_copyright(*args, &block)
click to toggle source
Keep defaults that aren't in ChefConfig::Config
# File lib/ridley/chef/config.rb, line 19 def cookbook_copyright(*args, &block) ChefConfig::Config.cookbook_copyright(*args, &block) || 'YOUR_NAME' end
cookbook_email(*args, &block)
click to toggle source
# File lib/ridley/chef/config.rb, line 22 def cookbook_email(*args, &block) ChefConfig::Config.cookbook_email(*args, &block) || 'YOUR_EMAIL' end
cookbook_license(*args, &block)
click to toggle source
# File lib/ridley/chef/config.rb, line 25 def cookbook_license(*args, &block) ChefConfig::Config.cookbook_license(*args, &block) || 'reserved' end
method_missing(name, *args, &block)
click to toggle source
Behave just like ChefConfig::Config in general
# File lib/ridley/chef/config.rb, line 39 def method_missing(name, *args, &block) ChefConfig::Config.send(name, *args, &block) end
respond_to_missing?(name)
click to toggle source
# File lib/ridley/chef/config.rb, line 42 def respond_to_missing?(name) ChefConfig::Config.respond_to?(name) end
to_hash()
click to toggle source
The configuration as a hash
# File lib/ridley/chef/config.rb, line 30 def to_hash ChefConfig::Config.save(true) end