Class: Ridley::Chef::Config

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

Instance Method Summary collapse

Constructor Details

#initialize(path, options = {}) ⇒ Config

Create a new Chef Config object.

Parameters:

  • path (#to_s)

    the path to the configuration file

  • options (Hash) (defaults to: {})


12
13
14
15
16
# 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

Instance Method Details

#to_hashObject

The configuration as a hash



19
20
21
# File 'lib/ridley/chef/config.rb', line 19

def to_hash
  ChefConfig::Config.save(true)
end