Skip to content

Use a canonical root path representation. - #70

Open
samuel-williams-shopify wants to merge 1 commit into
mainfrom
canonical-root-path
Open

Use a canonical root path representation.#70
samuel-williams-shopify wants to merge 1 commit into
mainfrom
canonical-root-path

Conversation

@samuel-williams-shopify

Copy link
Copy Markdown
Contributor

Summary

  • Represent Utopia::Path.root as ["", ""], matching Utopia::Path["/"].
  • Normalize path operations that collapse to or traverse through the absolute root.
  • Keep Path#initialize as a direct component assignment while normalizing through Path.create and higher-level operations.

Behavioral changes

  • Path.root == Path["/"].
  • The root is a directory rather than a file.
  • The root local path is /, and its URL path remains /.
  • pop, dirname, simplify, split, ascent/descent, prefix checks, and shortest paths preserve the canonical root.

Testing

  • bundle exec sus test/utopia/path.rb (52 tests, 93 assertions).
  • COVERAGE=PartialSummary bundle exec bake test (369 tests, 894 assertions).
  • bundle exec rubocop lib/utopia/path.rb test/utopia/path.rb (no offenses).

Assisted-By: devx/cbdeae41-9308-4071-ad53-58cd92db2946
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant