Refactor ExtractsPath into a class
`ExtractsRef` module was refactored into a class `ExtractsRef::RefExtractor` that didn't depend on instance variables in !131125.
`ExtractsRef` module still exists because `ExtractsPath` module depends on `ExtractRef`.
`ExtractsPath` shares the same problems as `ExtractsRef` did and should be refactored into a class.
1. Contrary to what its location indicates (`lib`), it's been written to be used as a controller concern and the vast majority of its consumers are Rails controllers.
1. The module extensively uses instance variables to achieve its goals and it's hard to reason about the code https://gitlab.com/gitlab-org/gitlab/-/merge_requests/131125#note_1546934017.
- [x] Refactor `ExtractsPath` into a new class.
- [ ] Remove `ExtractsPath` and `ExtractsRef` module when done.
### Roadmap
1. [Extract `ExtractsRef` logic into a class `ExtractsRef::RefExtractor`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/131125) - :white_check_mark:
2. [Replace calls to `ExtractsRef` with `ExtractsRef::RefExtractor`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145438) - :white_check_mark:
3. [Use `ExtractsRef::RefExtractor` in `ExtractsRef`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/152068) - :white_check_mark:
4. [Merge `ExtractsRef` into `ExtractsPath`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/155245) - :white_check_mark:
5. Extract logic from `ExtractsPath` into a class - :tools:
6. Replace `ExtractsPath` calls with calls to new classes - :tools:
7. Remove `ExtractsPath` module - :tools:
issue