Refactor ExtractsPath into a class
ExtractsRef module was refactored into a class ExtractsRef::RefExtractor that didn't depend on instance variables in !131125 (merged).
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.
-
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. -
The module extensively uses instance variables to achieve its goals and it's hard to reason about the code !131125 (comment 1546934017).
-
Refactor ExtractsPathinto a new class. -
Remove ExtractsPathandExtractsRefmodule when done.
Roadmap
-
Extract
ExtractsReflogic into a classExtractsRef::RefExtractor-✅ -
Replace calls to
ExtractsRefwithExtractsRef::RefExtractor-✅ -
Use
ExtractsRef::RefExtractorinExtractsRef-✅ -
Merge
ExtractsRefintoExtractsPath-✅ - Extract logic from
ExtractsPathinto a class -🛠 - Replace
ExtractsPathcalls with calls to new classes -🛠 - Remove
ExtractsPathmodule -🛠
Edited by Vasilii Iakliushin