def convert_nils_to_empty_hashes(hash)
      hash.each_with_object({}) do |(key, value), h|
        h[key] =
          case value
          when nil  then {}
          when Hash then convert_nils_to_empty_hashes(value)
          else
            value
          end
      end
    end
def convert_nils_to_empty_hashes(hash)
      hash.each_with_object({}) do |(key, value), h|
        h[key] =
          case value
          when nil  then {}
          when Hash then convert_nils_to_empty_hashes(value)
          else
            value
          end
      end
    end
Normalizes `nil` values to empty hashes.

 This is useful for when we want to merge two configuration hashes
 together, since it's easier to merge two hashes than to have to check if
 one of the values is nil.