def build_constant_paths_cache(constant)
      paths = match_globbed_files(constant_to_path(constant))

      # Lets see if we can find anything when using dashes for the directory
      # names instead of underscores.
      if paths.empty?
        paths = match_globbed_files(constant_to_dashed_path(constant))
      end

      paths.map! { |p| File.expand_path(p) }

      ignore.each do |pattern|
        paths.reject! do |path|
          path.include?(pattern)
        end
      end

      # Ensure that the order is from top-level -> deeply nested files
      # instead of a random order.
      paths.sort! do |left, right|
        left.length <=> right.length
      end

      @constant_paths_cache[constant] = paths
    end
def build_constant_paths_cache(constant)
      paths = match_globbed_files(constant_to_path(constant))

      # Lets see if we can find anything when using dashes for the directory
      # names instead of underscores.
      if paths.empty?
        paths = match_globbed_files(constant_to_dashed_path(constant))
      end

      paths.map! { |p| File.expand_path(p) }

      ignore.each do |pattern|
        paths.reject! do |path|
          path.include?(pattern)
        end
      end

      # Ensure that the order is from top-level -> deeply nested files
      # instead of a random order.
      paths.sort! do |left, right|
        left.length <=> right.length
      end

      @constant_paths_cache[constant] = paths
    end
Searches all the files that could potentially define the given constant
 and caches them.

 @param [String] constant