class Zeitwerk::Loader

def all_expected_cpaths

: () -> Hash[String, String]

directories to their respective expected constant paths.
Returns a hash that maps the absolute paths of the managed files and
def all_expected_cpaths
  result = {}
  actual_roots.each do |root_dir, root_namespace|
    queue = [[root_dir, real_mod_name(root_namespace)]]
    while (dir, cpath = queue.shift)
      result[dir] = cpath
      prefix = cpath == "Object" ? "" : cpath + "::"
      ls(dir) do |basename, abspath, ftype|
        if ftype == :file
          basename.delete_suffix!(".rb")
          result[abspath] = prefix + inflector.camelize(basename, abspath)
        else
          if collapse?(abspath)
            queue << [abspath, cpath]
          else
            queue << [abspath, prefix + inflector.camelize(basename, abspath)]
          end
        end
      end
    end
  end
  result
end