Skip to content

Optionally preserve empty path segments. - #15

Open
samuel-williams-shopify wants to merge 1 commit into
mainfrom
preserve-empty-path-segments
Open

Optionally preserve empty path segments.#15
samuel-williams-shopify wants to merge 1 commit into
mainfrom
preserve-empty-path-segments

Conversation

@samuel-williams-shopify

Copy link
Copy Markdown
Contributor

Summary

  • Add preserve_empty: to Protocol::URL::Path#simplify and #simplify!.
  • Preserve repeated separators while still resolving dot segments when explicitly requested.
  • Keep separator collapsing as the default behavior.
  • Document explicit composition with path.normalize.simplify(preserve_empty: true).

This intentionally does not add an option to Relative#normalize!, keeping its canonicalization contract narrow while allowing callers to compose the lower-level operations when original empty segments are significant.

Verification

  • 374 tests pass with 546 assertions.
  • RuboCop reports no offenses.

@ioquatix

Copy link
Copy Markdown
Member
image

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.

2 participants