Apply the required options to {Chef::Config}.

 @api private
 @return [void]
501208
def apply_chef_config!
      Chef::Log.level = @options[:log_level]

      Chef::Config.reset!
      Chef::Config.formatters.clear
      Chef::Config.add_formatter('chefspec')
      Chef::Config[:cache_type]      = 'Memory'
      Chef::Config[:client_key]      = nil
      Chef::Config[:client_name]     = nil
      Chef::Config[:node_name]       = nil
      Chef::Config[:file_cache_path] = @options[:file_cache_path] || file_cache_path
      Chef::Config[:cookbook_path]   = Array(@options[:cookbook_path])
      # If the word cookbook is in the folder name, treat it as the path. Otherwise
      # it's probably not a cookbook path and so we activate the gross hack mode.
      if Chef::Config[:cookbook_path].size == 1 && Chef::Config[:cookbook_path].first !~ /cookbook/
        Chef::Config[:chefspec_cookbook_root] = @options[:cookbook_root]
      end
      Chef::Config[:no_lazy_load]    = true
      Chef::Config[:role_path]       = Array(@options[:role_path])
      Chef::Config[:force_logger]    = true
      Chef::Config[:solo]            = true
      Chef::Config[:solo_legacy_mode] = true
      Chef::Config[:use_policyfile]  = false
      Chef::Config[:environment_path] = @options[:environment_path]
    end
1268193
def chef_runner_options
      super.tap do |options|
        options[:halite_gemspec] = halite_gemspec
        # And some legacy data.
        options[:default_attributes].update(default_attributes)
        options[:normal_attributes].update(normal_attributes)
        options[:override_attributes].update(override_attributes)
        options.update(chefspec_options)
      end
    end
481827
public function applyConfigOverrides()
    {
        // init
        $config_items = [];

        foreach ($this->settings_default as $key => $value) {
            if (ee()->config->item($key)) {
                $config_items[$key] = ee()->config->item($key);
            }
        }

        if (is_array($this->settings)) {
            $this->settings = array_merge($this->settings, $config_items);
        }
    }
159962
private function applyRenames()
    {
        foreach ($this->renames as $rename) {
            $mainMenuOriginal = $rename[0];
            $subMenuOriginal  = $rename[1];
            $mainMenuRenamed  = $rename[2];
            $subMenuRenamed   = $rename[3];

            // Are we changing a submenu?
            if (!empty($subMenuOriginal)) {
                if (isset($this->menu[$mainMenuOriginal][$subMenuOriginal])) {
                    $save = $this->menu[$mainMenuOriginal][$subMenuOriginal];
                    $save['_name'] = $subMenuRenamed;
                    unset($this->menu[$mainMenuOriginal][$subMenuOriginal]);
                    $this->menu[$mainMenuRenamed][$subMenuRenamed] = $save;
                }
            } // Changing a first-level element
            elseif (isset($this->menu[$mainMenuOriginal])) {
                $save = $this->menu[$mainMenuOriginal];
                $save['_name'] = $mainMenuRenamed;
                unset($this->menu[$mainMenuOriginal]);
                $this->menu[$mainMenuRenamed] = $save;
            }
        }
    }
758081
def init_config(options={})
      options = options.to_symbol_keys

      if !options[:method]
        abort "Please provide a deployment method. e.g. #{METHODS.keys}"
      end

      @options = DEFAULT_OPTIONS.deep_merge(options)
      write_config
      check_gitignore
    end
409274
def set_options(options)
      @options = MiniReadline::BASE_OPTIONS
                   .merge(instance_options)
                   .merge(options)

      @options[:window_width] = MiniTerm.width - 1
      set_prompt(@options[:prompt])
      verify_mask(@options[:secret_mask])
    end
1073245
def options
      VALID_OPTION_KEYS.inject({}) do |option, key|
        option.merge!(key => send(key))
      end
    end
1185396
def apply(values=nil)
      (values || {}).each do |name, value|
        if has_namespace?(name)
          # recursively apply namespace values if hash given; ignore otherwise.
          get_namespace(name).apply(value) if value.kind_of?(Hash)
        else
          # this is meant as a "value importer", so always apply distinct values
          # to prevent unintentional pass-by-ref shared objects.
          # be sure to use the namespace's writer to write the option value
          @ns.send("#{name}=", NsOptions.distinct_value(value))
        end
      end
    end
1049799
def configure_defaults
      # Enable all warnings except some.
      set_warning(:all, true)
      set_warning(:link_auto, false)
      set_warning(:param_count, false)
      set_warning(:fires, false)
      set_warning(:nodoc, false)
    end
1172348
def apply_options(options)
      return unless options
      
      options.each do |key, value|
        options[key] = value.call if value.kind_of?(Proc)
      end
      @_options ||= {}
      @_options.merge! options
      @input  = setup_input_method(options[:input] || @input)
      @output = setup_output_method(options[:output] || @output)
      @output.silenced = options.key?(:silent) ? options[:silent] : !@output || @output.silenced?
      @line_processor = options[:processor] || options[:line_processor] || @line_processor
      @allow_ruby = options.key?(:allow_ruby) ? options[:allow_ruby] : @allow_ruby

      if options[:namespace]
        ns = options[:namespace] == :self ? self : options[:namespace]
        @namespace.replace(ns)
      end
      
      if @input
        @input.output = @output
        @input.prompt = prompt
        if @input.respond_to?(:completion_proc)
          @input.completion_proc = proc { |line| autocomplete(line) }
        end
      end
    end
183049
def configured?
      non_empty_options = options.reject { |k,v| v.empty? }.keys.map(&:intern)
      (required_fields - non_empty_options).empty?
    end
895853
def upload_cookbooks!
      return if @cookbooks_uploaded
      loader = Chef::CookbookLoader.new(Chef::Config[:cookbook_path])
      loader.load_cookbooks
      cookbook_uploader_for(loader).upload_cookbooks
      @cookbooks_uploaded = true
    end
858266
def options
      VALID_OPTIONS.inject({}) do |option, key|
        option.merge!(key => send(key))
      end
    end
824949
def expand_options(options={}, opts={}, model=nil)
      options = get_value_of options, model
      config_opts = {
        :not_expand => [],
        :not_call_symbol => []
      }.merge! opts
      if options.kind_of? Hash
        opts = {}
        options.each do |column, config|
          if not config_opts[:not_expand].include? column.to_sym
            if not config_opts[:not_call_symbol].include? config
              opts[column.to_sym] = expand_options(get_value_of(config, model), config_opts, model)
            else
              opts[column.to_sym] = expand_options(config, config_opts, model)
            end
          else
            opts[column.to_sym] = config
          end
        end
        return opts
      else
        return get_value_of options, model
      end
    end
162731
def options
      {}.tap{ |options| VALID_OPTIONS_KEYS.each{|k| options[k] = send(k) } }
    end
173633
def check_settings!
      required_keys = %w(
        org
        project
      )

      required_keys.each do |key|
        unless Settings.send key
          error = "Config is missing required key '#{key}'. Please add it " \
            "to #{config_path} and try again."
          error += "\n\nFor more info, see https://github.com/jutonz/dctl_rb#required-keys"
          puts Rainbow(error).red
          exit 1
        end
      end
    end
668841
private function applyEdits()
    {
        foreach ($this->edits as $edit) {
            $mainMenuToEdit = $edit[0];
            $subMenuToEdit  = $edit[1];
            $newUrl         = $edit[2];

            if ($subMenuToEdit === null) {
                if (isset($this->menu[$mainMenuToEdit])) {
                    $menuDataToEdit = &$this->menu[$mainMenuToEdit];
                } else {
                    $menuDataToEdit = null;
                }
            } else {
                if (isset($this->menu[$mainMenuToEdit][$subMenuToEdit])) {
                    $menuDataToEdit = &$this->menu[$mainMenuToEdit][$subMenuToEdit];
                } else {
                    $menuDataToEdit = null;
                }
            }

            if (empty($menuDataToEdit)) {
                $this->buildMenuItem($mainMenuToEdit, $subMenuToEdit, $newUrl);
            } else {
                $menuDataToEdit['_url'] = $newUrl;
            }
        }
    }