[go: up one dir, main page]

Skip to content

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.

  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.

  2. The module extensively uses instance variables to achieve its goals and it's hard to reason about the code !131125 (comment 1546934017).

  • Refactor ExtractsPath into a new class.
  • Remove ExtractsPath and ExtractsRef module when done.

Roadmap

  1. Extract ExtractsRef logic into a class ExtractsRef::RefExtractor -
  2. Replace calls to ExtractsRef with ExtractsRef::RefExtractor -
  3. Use ExtractsRef::RefExtractor in ExtractsRef -
  4. Merge ExtractsRef into ExtractsPath -
  5. Extract logic from ExtractsPath into a class - 🛠
  6. Replace ExtractsPath calls with calls to new classes - 🛠
  7. Remove ExtractsPath module - 🛠
Edited by Vasilii Iakliushin