splitwise / super_diff

A more helpful way to view differences between complex data structures in RSpec.
https://splitwise.github.io/super_diff/
MIT License
960 stars 50 forks source link

Reorganize codebase #230

Closed mcmire closed 6 months ago

mcmire commented 6 months ago

In attempting to detail the architecture of this codebase, I realized that it would be easier if the parts of SuperDiff that implemented differs, inspection tree builders, operation tree builders, operation tree flatteners, and operation trees for Ruby objects were split off into their own directory. To that end, alongside RSpec, ActiveRecord, and ActiveSupport, there is now a "Basic" feature module. In addition, to make the file structure a little flatter, I've also renamed InspectionTreeBuilders in various feature modules up one level (so, ObjectInspection::InspectionTreeBuilders is now simply InspectionTreeBuilders).

Following this change, SuperDiff can now be divided into 4 layers (here I'm putting CSI in brackets because it's not a public module):

          ----------------- [SuperDiff::CSI]
        /                     /     |
       /           SuperDiff::Core ----------------------
      |              /    |     \   |                    \
      |       /^^^^^^     |  SuperDiff::Basic             \
      |      /            |   /     |     \                \
      |     | /^^^^^^^^^^^|^^^^     |      ^^^^^^^^^^^^^\   \
SuperDiff::RSpec         SuperDiff::ActiveRecord     SuperDiff::ActiveSupport

Here is a full list of renames:

To maintain backward compatibility, I've left all of the original constants in place, but they will now print deprecation warnings when used. I will remove them in 1.0.0.