def tier_environment_variable_overrides(lower_config = {})
      tcfg_env_vars = ENV.keys.select { |ev| ev =~ /^#{tcfg_env_var_prefix}/ }
      tcfg_env = ENV.to_hash.slice(*tcfg_env_vars)
      tcfg_env.each_pair do |full_var_name, value|
        var_chain = full_var_name.sub(/^#{tcfg_env_var_prefix}/, '').split('-')
        next if var_chain.first.casecmp('ENVIRONMENT').zero?
        parent_of_config_to_modify = lower_config
        var_chain[0...-1].each do |parent_key|
          unless parent_of_config_to_modify.respond_to?(:key?) &&
                 parent_of_config_to_modify.key?(parent_key)
            raise BadParentInDeepOverrideError,
                  "No such parent '#{parent_key}' for deep override '#{full_var_name}'"
          end
          parent_of_config_to_modify = parent_of_config_to_modify[parent_key]
        end
        unless parent_of_config_to_modify.respond_to?(:key?) &&
               parent_of_config_to_modify.key?(var_chain.last)
          raise NoSuchConfigurationKeyError,
                "No such configuration for '#{var_chain.last}' for override var '#{full_var_name}'"
        end
        parent_of_config_to_modify[var_chain.last] = value
      end
    end
def tier_environment_variable_overrides(lower_config = {})
      tcfg_env_vars = ENV.keys.select { |ev| ev =~ /^#{tcfg_env_var_prefix}/ }
      tcfg_env = ENV.to_hash.slice(*tcfg_env_vars)
      tcfg_env.each_pair do |full_var_name, value|
        var_chain = full_var_name.sub(/^#{tcfg_env_var_prefix}/, '').split('-')
        next if var_chain.first.casecmp('ENVIRONMENT').zero?
        parent_of_config_to_modify = lower_config
        var_chain[0...-1].each do |parent_key|
          unless parent_of_config_to_modify.respond_to?(:key?) &&
                 parent_of_config_to_modify.key?(parent_key)
            raise BadParentInDeepOverrideError,
                  "No such parent '#{parent_key}' for deep override '#{full_var_name}'"
          end
          parent_of_config_to_modify = parent_of_config_to_modify[parent_key]
        end
        unless parent_of_config_to_modify.respond_to?(:key?) &&
               parent_of_config_to_modify.key?(var_chain.last)
          raise NoSuchConfigurationKeyError,
                "No such configuration for '#{var_chain.last}' for override var '#{full_var_name}'"
        end
        parent_of_config_to_modify[var_chain.last] = value
      end
    end
environment variable overrides is the most complex tier
 The rules:
 - You can only override configuration that exists in a lower tier. An exception is raised otherwise
 - You can use a - character to override deeply
 - All env variables must start with the prefix (T_)
 - ignore the special T_ENVIRONMENT variable