# File lib/pathutil.rb, line 615
  def aggressive_cleanpath
    return self.class.new("/") if root?

    _out = split_path.each_with_object([]) do |part, out|
      next if part == "." || (part == ".." && out.last == "")
      if part == ".." && out.last && out.last != ".."
        out.pop

      else
        out.push(
          part
        )
      end
    end

    # --

    return self.class.new("/") if _out == [""].freeze
    return self.class.new(".") if _out.empty? && (end_with?(".") || relative?)
    self.class.new(_out.join("/"))
  end