Sha256: bab8776061285c0b7566cfcbd656713af9af8e2dac3ce75e2893f33765cd2f4d

Contents?: true

Size: 608 Bytes

Versions: 1

Compression:

Stored size: 608 Bytes

Contents

require 'chef-config/config'
require 'chef-config/workstation_config_loader'
require 'socket'

module Ridley::Chef
  class Config
    # Create a new Chef Config object.
    #
    # @param [#to_s] path
    #   the path to the configuration file
    # @param [Hash] options
    def initialize(path, options = {})
      ChefConfig::WorkstationConfigLoader.new(path).load
      ChefConfig::Config.merge!(options)
      ChefConfig::Config.export_proxies # Set proxy settings as environment variables
    end

    # The configuration as a hash
    def to_hash
      ChefConfig::Config.save(true)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ridley-4.4.0 lib/ridley/chef/config.rb