super_diff 0.11.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (231) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -166
  3. data/lib/super_diff/active_record/differs/active_record_relation.rb +1 -1
  4. data/lib/super_diff/active_record/inspection_tree_builders/active_record_model.rb +57 -0
  5. data/lib/super_diff/active_record/inspection_tree_builders/active_record_relation.rb +34 -0
  6. data/lib/super_diff/active_record/inspection_tree_builders.rb +14 -0
  7. data/lib/super_diff/active_record/monkey_patches.rb +6 -3
  8. data/lib/super_diff/active_record/object_inspection.rb +16 -4
  9. data/lib/super_diff/active_record/operation_tree_builders/active_record_model.rb +6 -2
  10. data/lib/super_diff/active_record/operation_tree_builders/active_record_relation.rb +1 -1
  11. data/lib/super_diff/active_record/operation_tree_flatteners/active_record_relation.rb +1 -1
  12. data/lib/super_diff/active_record/operation_trees/active_record_relation.rb +1 -1
  13. data/lib/super_diff/active_record.rb +12 -16
  14. data/lib/super_diff/active_support/differs/hash_with_indifferent_access.rb +1 -1
  15. data/lib/super_diff/active_support/inspection_tree_builders/hash_with_indifferent_access.rb +44 -0
  16. data/lib/super_diff/active_support/inspection_tree_builders/ordered_options.rb +44 -0
  17. data/lib/super_diff/active_support/inspection_tree_builders.rb +14 -0
  18. data/lib/super_diff/active_support/object_inspection.rb +16 -4
  19. data/lib/super_diff/active_support/operation_tree_builders/hash_with_indifferent_access.rb +1 -1
  20. data/lib/super_diff/active_support/operation_tree_flatteners/hash_with_indifferent_access.rb +1 -1
  21. data/lib/super_diff/active_support/operation_trees/hash_with_indifferent_access.rb +1 -1
  22. data/lib/super_diff/active_support.rb +11 -15
  23. data/lib/super_diff/basic/diff_formatters/collection.rb +135 -0
  24. data/lib/super_diff/basic/diff_formatters/multiline_string.rb +34 -0
  25. data/lib/super_diff/basic/diff_formatters.rb +11 -0
  26. data/lib/super_diff/basic/differs/array.rb +17 -0
  27. data/lib/super_diff/basic/differs/custom_object.rb +19 -0
  28. data/lib/super_diff/basic/differs/date_like.rb +17 -0
  29. data/lib/super_diff/basic/differs/default_object.rb +24 -0
  30. data/lib/super_diff/basic/differs/hash.rb +17 -0
  31. data/lib/super_diff/basic/differs/multiline_string.rb +18 -0
  32. data/lib/super_diff/basic/differs/time_like.rb +17 -0
  33. data/lib/super_diff/basic/differs.rb +24 -0
  34. data/lib/super_diff/{object_inspection → basic}/inspection_tree_builders/array.rb +3 -3
  35. data/lib/super_diff/{object_inspection → basic}/inspection_tree_builders/custom_object.rb +3 -3
  36. data/lib/super_diff/{object_inspection → basic}/inspection_tree_builders/date_like.rb +3 -3
  37. data/lib/super_diff/{object_inspection → basic}/inspection_tree_builders/default_object.rb +5 -7
  38. data/lib/super_diff/{object_inspection → basic}/inspection_tree_builders/hash.rb +3 -3
  39. data/lib/super_diff/{object_inspection → basic}/inspection_tree_builders/primitive.rb +3 -3
  40. data/lib/super_diff/{object_inspection → basic}/inspection_tree_builders/time_like.rb +3 -3
  41. data/lib/super_diff/basic/inspection_tree_builders.rb +20 -0
  42. data/lib/super_diff/basic/operation_tree_builders/array.rb +111 -0
  43. data/lib/super_diff/basic/operation_tree_builders/custom_object.rb +42 -0
  44. data/lib/super_diff/basic/operation_tree_builders/date_like.rb +17 -0
  45. data/lib/super_diff/basic/operation_tree_builders/default_object.rb +117 -0
  46. data/lib/super_diff/basic/operation_tree_builders/hash.rb +222 -0
  47. data/lib/super_diff/basic/operation_tree_builders/multiline_string.rb +90 -0
  48. data/lib/super_diff/basic/operation_tree_builders/time_like.rb +26 -0
  49. data/lib/super_diff/basic/operation_tree_builders.rb +34 -0
  50. data/lib/super_diff/basic/operation_tree_flatteners/array.rb +17 -0
  51. data/lib/super_diff/basic/operation_tree_flatteners/collection.rb +140 -0
  52. data/lib/super_diff/basic/operation_tree_flatteners/custom_object.rb +30 -0
  53. data/lib/super_diff/basic/operation_tree_flatteners/default_object.rb +32 -0
  54. data/lib/super_diff/basic/operation_tree_flatteners/hash.rb +35 -0
  55. data/lib/super_diff/basic/operation_tree_flatteners/multiline_string.rb +20 -0
  56. data/lib/super_diff/basic/operation_tree_flatteners.rb +24 -0
  57. data/lib/super_diff/basic/operation_trees/array.rb +17 -0
  58. data/lib/super_diff/basic/operation_trees/custom_object.rb +17 -0
  59. data/lib/super_diff/basic/operation_trees/default_object.rb +42 -0
  60. data/lib/super_diff/basic/operation_trees/hash.rb +17 -0
  61. data/lib/super_diff/basic/operation_trees/multiline_string.rb +17 -0
  62. data/lib/super_diff/basic/operation_trees.rb +25 -0
  63. data/lib/super_diff/basic.rb +48 -0
  64. data/lib/super_diff/{differs/base.rb → core/abstract_differ.rb} +2 -2
  65. data/lib/super_diff/core/abstract_inspection_tree_builder.rb +26 -0
  66. data/lib/super_diff/{operation_trees/base.rb → core/abstract_operation_tree.rb} +6 -2
  67. data/lib/super_diff/{operation_tree_builders/base.rb → core/abstract_operation_tree_builder.rb} +4 -8
  68. data/lib/super_diff/{operation_tree_flatteners/base.rb → core/abstract_operation_tree_flattener.rb} +2 -2
  69. data/lib/super_diff/{operations → core}/binary_operation.rb +1 -1
  70. data/lib/super_diff/core/colorized_document_extensions.rb +20 -0
  71. data/lib/super_diff/core/configuration.rb +192 -0
  72. data/lib/super_diff/core/differ_dispatcher.rb +31 -0
  73. data/lib/super_diff/core/gem_version.rb +47 -0
  74. data/lib/super_diff/core/helpers.rb +88 -0
  75. data/lib/super_diff/core/implementation_checks.rb +21 -0
  76. data/lib/super_diff/{object_inspection → core}/inspection_tree.rb +7 -6
  77. data/lib/super_diff/core/inspection_tree_builder_dispatcher.rb +23 -0
  78. data/lib/super_diff/{object_inspection/nodes → core/inspection_tree_nodes}/as_lines_when_rendering_to_lines.rb +9 -3
  79. data/lib/super_diff/{object_inspection/nodes → core/inspection_tree_nodes}/as_prefix_when_rendering_to_lines.rb +3 -3
  80. data/lib/super_diff/{object_inspection/nodes → core/inspection_tree_nodes}/as_prelude_when_rendering_to_lines.rb +3 -3
  81. data/lib/super_diff/{object_inspection/nodes → core/inspection_tree_nodes}/as_single_line.rb +3 -3
  82. data/lib/super_diff/{object_inspection/nodes → core/inspection_tree_nodes}/base.rb +2 -2
  83. data/lib/super_diff/{object_inspection/nodes → core/inspection_tree_nodes}/inspection.rb +7 -11
  84. data/lib/super_diff/{object_inspection/nodes → core/inspection_tree_nodes}/nesting.rb +2 -2
  85. data/lib/super_diff/{object_inspection/nodes → core/inspection_tree_nodes}/only_when.rb +2 -2
  86. data/lib/super_diff/{object_inspection/nodes → core/inspection_tree_nodes}/text.rb +2 -2
  87. data/lib/super_diff/{object_inspection/nodes → core/inspection_tree_nodes}/when_empty.rb +2 -2
  88. data/lib/super_diff/{object_inspection/nodes → core/inspection_tree_nodes}/when_non_empty.rb +2 -2
  89. data/lib/super_diff/{object_inspection/nodes → core/inspection_tree_nodes}/when_rendering_to_lines.rb +2 -2
  90. data/lib/super_diff/{object_inspection/nodes → core/inspection_tree_nodes}/when_rendering_to_string.rb +2 -2
  91. data/lib/super_diff/core/inspection_tree_nodes.rb +55 -0
  92. data/lib/super_diff/core/line.rb +85 -0
  93. data/lib/super_diff/{errors → core}/no_differ_available_error.rb +1 -1
  94. data/lib/super_diff/core/no_inspection_tree_builder_available_error.rb +21 -0
  95. data/lib/super_diff/core/no_operation_tree_available_error.rb +20 -0
  96. data/lib/super_diff/core/no_operation_tree_builder_available_error.rb +24 -0
  97. data/lib/super_diff/{operation_tree_builders/main.rb → core/operation_tree_builder_dispatcher.rb} +9 -13
  98. data/lib/super_diff/core/operation_tree_finder.rb +27 -0
  99. data/lib/super_diff/core/prefix_for_next_inspection_tree_node.rb +6 -0
  100. data/lib/super_diff/core/prelude_for_next_inspection_tree_node.rb +6 -0
  101. data/lib/super_diff/core/recursion_guard.rb +52 -0
  102. data/lib/super_diff/core/tiered_lines.rb +6 -0
  103. data/lib/super_diff/core/tiered_lines_elider.rb +472 -0
  104. data/lib/super_diff/core/tiered_lines_formatter.rb +77 -0
  105. data/lib/super_diff/{operations → core}/unary_operation.rb +1 -1
  106. data/lib/super_diff/core.rb +69 -0
  107. data/lib/super_diff/differs.rb +19 -12
  108. data/lib/super_diff/equality_matchers/array.rb +3 -3
  109. data/lib/super_diff/equality_matchers/default.rb +8 -3
  110. data/lib/super_diff/equality_matchers/hash.rb +3 -3
  111. data/lib/super_diff/equality_matchers/multiline_string.rb +3 -3
  112. data/lib/super_diff/equality_matchers/primitive.rb +3 -3
  113. data/lib/super_diff/equality_matchers/singleline_string.rb +2 -2
  114. data/lib/super_diff/errors.rb +12 -8
  115. data/lib/super_diff/object_inspection.rb +63 -14
  116. data/lib/super_diff/operation_tree_builders.rb +19 -15
  117. data/lib/super_diff/operation_tree_flatteners.rb +19 -16
  118. data/lib/super_diff/operation_trees.rb +19 -9
  119. data/lib/super_diff/operations.rb +12 -2
  120. data/lib/super_diff/rspec/augmented_matcher.rb +1 -1
  121. data/lib/super_diff/rspec/differ.rb +4 -5
  122. data/lib/super_diff/rspec/differs/collection_containing_exactly.rb +1 -1
  123. data/lib/super_diff/rspec/differs/collection_including.rb +1 -1
  124. data/lib/super_diff/rspec/differs/hash_including.rb +1 -1
  125. data/lib/super_diff/rspec/differs/object_having_attributes.rb +1 -1
  126. data/lib/super_diff/rspec/inspection_tree_builders/collection_containing_exactly.rb +34 -0
  127. data/lib/super_diff/rspec/inspection_tree_builders/collection_including.rb +40 -0
  128. data/lib/super_diff/rspec/inspection_tree_builders/double.rb +100 -0
  129. data/lib/super_diff/rspec/inspection_tree_builders/generic_describable_matcher.rb +17 -0
  130. data/lib/super_diff/rspec/inspection_tree_builders/hash_including.rb +40 -0
  131. data/lib/super_diff/rspec/inspection_tree_builders/instance_of.rb +25 -0
  132. data/lib/super_diff/rspec/inspection_tree_builders/kind_of.rb +25 -0
  133. data/lib/super_diff/rspec/inspection_tree_builders/object_having_attributes.rb +34 -0
  134. data/lib/super_diff/rspec/inspection_tree_builders/primitive.rb +9 -0
  135. data/lib/super_diff/rspec/inspection_tree_builders/value_within.rb +30 -0
  136. data/lib/super_diff/rspec/inspection_tree_builders.rb +40 -0
  137. data/lib/super_diff/rspec/object_inspection.rb +14 -4
  138. data/lib/super_diff/rspec/operation_tree_builders/collection_containing_exactly.rb +4 -4
  139. data/lib/super_diff/rspec/operation_tree_builders/collection_including.rb +1 -1
  140. data/lib/super_diff/rspec/operation_tree_builders/hash_including.rb +1 -1
  141. data/lib/super_diff/rspec/operation_tree_builders/object_having_attributes.rb +2 -2
  142. data/lib/super_diff/rspec.rb +20 -18
  143. data/lib/super_diff/version.rb +1 -1
  144. data/lib/super_diff.rb +69 -21
  145. data/spec/examples.txt +704 -543
  146. data/spec/support/integration/helpers.rb +4 -1
  147. data/spec/support/integration/matchers/produce_output_when_run_matcher.rb +1 -1
  148. data/spec/support/models/active_record/person.rb +8 -1
  149. data/spec/support/shared_examples/active_record.rb +5 -5
  150. data/spec/support/unit/helpers.rb +12 -1
  151. data/spec/support/unit/matchers/be_deprecated_in_favor_of.rb +39 -0
  152. data/spec/unit/active_record/object_inspection_spec.rb +5 -5
  153. data/spec/unit/{operation_tree_flatteners → basic/operation_tree_flatteners}/array_spec.rb +8 -8
  154. data/spec/unit/{operation_tree_flatteners → basic/operation_tree_flatteners}/custom_object_spec.rb +9 -9
  155. data/spec/unit/{operation_tree_flatteners → basic/operation_tree_flatteners}/default_object_spec.rb +9 -9
  156. data/spec/unit/{operation_tree_flatteners → basic/operation_tree_flatteners}/hash_spec.rb +8 -8
  157. data/spec/unit/{operation_tree_flatteners → basic/operation_tree_flatteners}/multiline_string_spec.rb +4 -4
  158. data/spec/unit/{helpers_spec.rb → core/helpers_spec.rb} +2 -2
  159. data/spec/unit/{tiered_lines_elider_spec.rb → core/tiered_lines_elider_spec.rb} +2 -2
  160. data/spec/unit/{tiered_lines_formatter_spec.rb → core/tiered_lines_formatter_spec.rb} +1 -1
  161. data/spec/unit/deprecations_spec.rb +176 -0
  162. data/spec/unit/equality_matchers/main_spec.rb +5 -5
  163. data/super_diff.gemspec +6 -0
  164. metadata +127 -115
  165. data/lib/super_diff/active_record/object_inspection/inspection_tree_builders/active_record_model.rb +0 -51
  166. data/lib/super_diff/active_record/object_inspection/inspection_tree_builders/active_record_relation.rb +0 -36
  167. data/lib/super_diff/active_record/object_inspection/inspection_tree_builders.rb +0 -16
  168. data/lib/super_diff/active_support/object_inspection/inspection_tree_builders/hash_with_indifferent_access.rb +0 -46
  169. data/lib/super_diff/active_support/object_inspection/inspection_tree_builders/ordered_options.rb +0 -46
  170. data/lib/super_diff/active_support/object_inspection/inspection_tree_builders.rb +0 -16
  171. data/lib/super_diff/colorized_document_extensions.rb +0 -18
  172. data/lib/super_diff/configuration.rb +0 -149
  173. data/lib/super_diff/diff_formatters/collection.rb +0 -132
  174. data/lib/super_diff/diff_formatters/multiline_string.rb +0 -31
  175. data/lib/super_diff/differs/array.rb +0 -15
  176. data/lib/super_diff/differs/custom_object.rb +0 -17
  177. data/lib/super_diff/differs/date_like.rb +0 -15
  178. data/lib/super_diff/differs/default_object.rb +0 -19
  179. data/lib/super_diff/differs/defaults.rb +0 -13
  180. data/lib/super_diff/differs/empty.rb +0 -13
  181. data/lib/super_diff/differs/hash.rb +0 -15
  182. data/lib/super_diff/differs/main.rb +0 -31
  183. data/lib/super_diff/differs/multiline_string.rb +0 -16
  184. data/lib/super_diff/differs/time_like.rb +0 -15
  185. data/lib/super_diff/gem_version.rb +0 -45
  186. data/lib/super_diff/helpers.rb +0 -86
  187. data/lib/super_diff/implementation_checks.rb +0 -19
  188. data/lib/super_diff/line.rb +0 -83
  189. data/lib/super_diff/object_inspection/inspection_tree_builders/base.rb +0 -27
  190. data/lib/super_diff/object_inspection/inspection_tree_builders/defaults.rb +0 -15
  191. data/lib/super_diff/object_inspection/inspection_tree_builders/main.rb +0 -30
  192. data/lib/super_diff/object_inspection/inspection_tree_builders.rb +0 -48
  193. data/lib/super_diff/object_inspection/nodes.rb +0 -50
  194. data/lib/super_diff/object_inspection/prefix_for_next_node.rb +0 -6
  195. data/lib/super_diff/object_inspection/prelude_for_next_node.rb +0 -6
  196. data/lib/super_diff/operation_tree_builders/array.rb +0 -107
  197. data/lib/super_diff/operation_tree_builders/custom_object.rb +0 -40
  198. data/lib/super_diff/operation_tree_builders/date_like.rb +0 -15
  199. data/lib/super_diff/operation_tree_builders/default_object.rb +0 -119
  200. data/lib/super_diff/operation_tree_builders/defaults.rb +0 -5
  201. data/lib/super_diff/operation_tree_builders/hash.rb +0 -218
  202. data/lib/super_diff/operation_tree_builders/multiline_string.rb +0 -86
  203. data/lib/super_diff/operation_tree_builders/time_like.rb +0 -24
  204. data/lib/super_diff/operation_tree_flatteners/array.rb +0 -15
  205. data/lib/super_diff/operation_tree_flatteners/collection.rb +0 -136
  206. data/lib/super_diff/operation_tree_flatteners/custom_object.rb +0 -28
  207. data/lib/super_diff/operation_tree_flatteners/default_object.rb +0 -31
  208. data/lib/super_diff/operation_tree_flatteners/hash.rb +0 -33
  209. data/lib/super_diff/operation_tree_flatteners/multiline_string.rb +0 -18
  210. data/lib/super_diff/operation_trees/array.rb +0 -15
  211. data/lib/super_diff/operation_trees/custom_object.rb +0 -15
  212. data/lib/super_diff/operation_trees/default_object.rb +0 -40
  213. data/lib/super_diff/operation_trees/defaults.rb +0 -5
  214. data/lib/super_diff/operation_trees/hash.rb +0 -15
  215. data/lib/super_diff/operation_trees/main.rb +0 -35
  216. data/lib/super_diff/operation_trees/multiline_string.rb +0 -15
  217. data/lib/super_diff/recursion_guard.rb +0 -50
  218. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/collection_containing_exactly.rb +0 -36
  219. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/collection_including.rb +0 -42
  220. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/double.rb +0 -102
  221. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/generic_describable_matcher.rb +0 -19
  222. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/hash_including.rb +0 -42
  223. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/instance_of.rb +0 -27
  224. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/kind_of.rb +0 -27
  225. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/object_having_attributes.rb +0 -36
  226. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/primitive.rb +0 -10
  227. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/value_within.rb +0 -32
  228. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders.rb +0 -48
  229. data/lib/super_diff/tiered_lines.rb +0 -4
  230. data/lib/super_diff/tiered_lines_elider.rb +0 -462
  231. data/lib/super_diff/tiered_lines_formatter.rb +0 -75
@@ -0,0 +1,176 @@
1
+ require "spec_helper"
2
+
3
+ # stree-ignore
4
+ common_constant_remappings = {
5
+ "SuperDiff::ColorizedDocumentExtensions" => "SuperDiff::Core::ColorizedDocumentExtensions",
6
+ "SuperDiff::Configuration" => "SuperDiff::Core::Configuration",
7
+ # TODO: Add back?
8
+ # "SuperDiff::DiffFormatters::Collection" => "SuperDiff::Basic::DiffFormatters::Collection",
9
+ # "SuperDiff::DiffFormatters::MultilineString" => "SuperDiff::Basic::DiffFormatters::MultilineString",
10
+ "SuperDiff::Differs::Array" => "SuperDiff::Basic::Differs::Array",
11
+ "SuperDiff::Differs::Base" => "SuperDiff::Core::AbstractDiffer",
12
+ "SuperDiff::Differs::CustomObject" => "SuperDiff::Basic::Differs::CustomObject",
13
+ "SuperDiff::Differs::DateLike" => "SuperDiff::Basic::Differs::DateLike",
14
+ "SuperDiff::Differs::DefaultObject" => "SuperDiff::Basic::Differs::DefaultObject",
15
+ "SuperDiff::Differs::Hash" => "SuperDiff::Basic::Differs::Hash",
16
+ "SuperDiff::Differs::MultilineString" => "SuperDiff::Basic::Differs::MultilineString",
17
+ "SuperDiff::Differs::TimeLike" => "SuperDiff::Basic::Differs::TimeLike",
18
+ "SuperDiff::Errors::NoDifferAvailableError" => "SuperDiff::Core::NoDifferAvailableError",
19
+ "SuperDiff::GemVersion" => "SuperDiff::Core::GemVersion",
20
+ "SuperDiff::Helpers" => "SuperDiff::Core::Helpers",
21
+ "SuperDiff::ImplementationChecks" => "SuperDiff::Core::ImplementationChecks",
22
+ "SuperDiff::Line" => "SuperDiff::Core::Line",
23
+ "SuperDiff::ObjectInspection::InspectionTree" => "SuperDiff::Core::InspectionTree",
24
+ "SuperDiff::ObjectInspection::InspectionTreeBuilders::Array" => "SuperDiff::Basic::InspectionTreeBuilders::Array",
25
+ "SuperDiff::ObjectInspection::InspectionTreeBuilders::Base" => "SuperDiff::Core::AbstractInspectionTreeBuilder",
26
+ "SuperDiff::ObjectInspection::InspectionTreeBuilders::CustomObject" => "SuperDiff::Basic::InspectionTreeBuilders::CustomObject",
27
+ "SuperDiff::ObjectInspection::InspectionTreeBuilders::DateLike" => "SuperDiff::Basic::InspectionTreeBuilders::DateLike",
28
+ "SuperDiff::ObjectInspection::InspectionTreeBuilders::DefaultObject" => "SuperDiff::Basic::InspectionTreeBuilders::DefaultObject",
29
+ "SuperDiff::ObjectInspection::InspectionTreeBuilders::Hash" => "SuperDiff::Basic::InspectionTreeBuilders::Hash",
30
+ "SuperDiff::ObjectInspection::InspectionTreeBuilders::Primitive" => "SuperDiff::Basic::InspectionTreeBuilders::Primitive",
31
+ "SuperDiff::ObjectInspection::InspectionTreeBuilders::TimeLike" => "SuperDiff::Basic::InspectionTreeBuilders::TimeLike",
32
+ "SuperDiff::ObjectInspection::Nodes::AsLinesWhenRenderingToLines" => "SuperDiff::Core::InspectionTreeNodes::AsLinesWhenRenderingToLines",
33
+ "SuperDiff::ObjectInspection::Nodes::AsPrefixWhenRenderingToLines" => "SuperDiff::Core::InspectionTreeNodes::AsPrefixWhenRenderingToLines",
34
+ "SuperDiff::ObjectInspection::Nodes::AsPreludeWhenRenderingToLines" => "SuperDiff::Core::InspectionTreeNodes::AsPreludeWhenRenderingToLines",
35
+ "SuperDiff::ObjectInspection::Nodes::AsSingleLine" => "SuperDiff::Core::InspectionTreeNodes::AsSingleLine",
36
+ "SuperDiff::ObjectInspection::Nodes::Base" => "SuperDiff::Core::InspectionTreeNodes::Base",
37
+ "SuperDiff::ObjectInspection::Nodes::Inspection" => "SuperDiff::Core::InspectionTreeNodes::Inspection",
38
+ "SuperDiff::ObjectInspection::Nodes::Nesting" => "SuperDiff::Core::InspectionTreeNodes::Nesting",
39
+ "SuperDiff::ObjectInspection::Nodes::OnlyWhen" => "SuperDiff::Core::InspectionTreeNodes::OnlyWhen",
40
+ "SuperDiff::ObjectInspection::Nodes::Text" => "SuperDiff::Core::InspectionTreeNodes::Text",
41
+ "SuperDiff::ObjectInspection::Nodes::WhenEmpty" => "SuperDiff::Core::InspectionTreeNodes::WhenEmpty",
42
+ "SuperDiff::ObjectInspection::Nodes::WhenNonEmpty" => "SuperDiff::Core::InspectionTreeNodes::WhenNonEmpty",
43
+ "SuperDiff::ObjectInspection::Nodes::WhenRenderingToLines" => "SuperDiff::Core::InspectionTreeNodes::WhenRenderingToLines",
44
+ "SuperDiff::ObjectInspection::Nodes::WhenRenderingToString" => "SuperDiff::Core::InspectionTreeNodes::WhenRenderingToString",
45
+ "SuperDiff::ObjectInspection::PrefixForNextNode" => "SuperDiff::Core::PrefixForNextInspectionTreeNode",
46
+ "SuperDiff::ObjectInspection::PreludeForNextNode" => "SuperDiff::Core::PreludeForNextInspectionTreeNode",
47
+ "SuperDiff::OperationTreeBuilders::Array" => "SuperDiff::Basic::OperationTreeBuilders::Array",
48
+ "SuperDiff::OperationTreeBuilders::Base" => "SuperDiff::Core::AbstractOperationTreeBuilder",
49
+ "SuperDiff::OperationTreeBuilders::CustomObject" => "SuperDiff::Basic::OperationTreeBuilders::CustomObject",
50
+ "SuperDiff::OperationTreeBuilders::DateLike" => "SuperDiff::Basic::OperationTreeBuilders::DateLike",
51
+ "SuperDiff::OperationTreeBuilders::DefaultObject" => "SuperDiff::Basic::OperationTreeBuilders::DefaultObject",
52
+ "SuperDiff::OperationTreeBuilders::Hash" => "SuperDiff::Basic::OperationTreeBuilders::Hash",
53
+ "SuperDiff::OperationTreeBuilders::MultilineString" => "SuperDiff::Basic::OperationTreeBuilders::MultilineString",
54
+ "SuperDiff::OperationTreeBuilders::TimeLike" => "SuperDiff::Basic::OperationTreeBuilders::TimeLike",
55
+ "SuperDiff::OperationTreeFlatteners::Array" => "SuperDiff::Basic::OperationTreeFlatteners::Array",
56
+ "SuperDiff::OperationTreeFlatteners::Base" => "SuperDiff::Core::AbstractOperationTreeFlattener",
57
+ "SuperDiff::OperationTreeFlatteners::Collection" => "SuperDiff::Basic::OperationTreeFlatteners::Collection",
58
+ "SuperDiff::OperationTreeFlatteners::CustomObject" => "SuperDiff::Basic::OperationTreeFlatteners::CustomObject",
59
+ "SuperDiff::OperationTreeFlatteners::DefaultObject" => "SuperDiff::Basic::OperationTreeFlatteners::DefaultObject",
60
+ "SuperDiff::OperationTreeFlatteners::Hash" => "SuperDiff::Basic::OperationTreeFlatteners::Hash",
61
+ "SuperDiff::OperationTreeFlatteners::MultilineString" => "SuperDiff::Basic::OperationTreeFlatteners::MultilineString",
62
+ "SuperDiff::OperationTrees::Array" => "SuperDiff::Basic::OperationTrees::Array",
63
+ "SuperDiff::OperationTrees::Base" => "SuperDiff::Core::AbstractOperationTree",
64
+ "SuperDiff::OperationTrees::CustomObject" => "SuperDiff::Basic::OperationTrees::CustomObject",
65
+ "SuperDiff::OperationTrees::DefaultObject" => "SuperDiff::Basic::OperationTrees::DefaultObject",
66
+ "SuperDiff::OperationTrees::Hash" => "SuperDiff::Basic::OperationTrees::Hash",
67
+ "SuperDiff::OperationTrees::MultilineString" => "SuperDiff::Basic::OperationTrees::MultilineString",
68
+ "SuperDiff::Operations::BinaryOperation" => "SuperDiff::Core::BinaryOperation",
69
+ "SuperDiff::Operations::UnaryOperation" => "SuperDiff::Core::UnaryOperation",
70
+ "SuperDiff::RSpec::ObjectInspection::InspectionTreeBuilders::CollectionContainingExactly" => "SuperDiff::RSpec::InspectionTreeBuilders::CollectionContainingExactly",
71
+ "SuperDiff::RSpec::ObjectInspection::InspectionTreeBuilders::CollectionIncluding" => "SuperDiff::RSpec::InspectionTreeBuilders::CollectionIncluding",
72
+ "SuperDiff::RSpec::ObjectInspection::InspectionTreeBuilders::Double" => "SuperDiff::RSpec::InspectionTreeBuilders::Double",
73
+ "SuperDiff::RSpec::ObjectInspection::InspectionTreeBuilders::GenericDescribableMatcher" => "SuperDiff::RSpec::InspectionTreeBuilders::GenericDescribableMatcher",
74
+ "SuperDiff::RSpec::ObjectInspection::InspectionTreeBuilders::HashIncluding" => "SuperDiff::RSpec::InspectionTreeBuilders::HashIncluding",
75
+ "SuperDiff::RSpec::ObjectInspection::InspectionTreeBuilders::InstanceOf" => "SuperDiff::RSpec::InspectionTreeBuilders::InstanceOf",
76
+ "SuperDiff::RSpec::ObjectInspection::InspectionTreeBuilders::KindOf" => "SuperDiff::RSpec::InspectionTreeBuilders::KindOf",
77
+ "SuperDiff::RSpec::ObjectInspection::InspectionTreeBuilders::ObjectHavingAttributes" => "SuperDiff::RSpec::InspectionTreeBuilders::ObjectHavingAttributes",
78
+ "SuperDiff::RSpec::ObjectInspection::InspectionTreeBuilders::Primitive" => "SuperDiff::RSpec::InspectionTreeBuilders::Primitive",
79
+ "SuperDiff::RSpec::ObjectInspection::InspectionTreeBuilders::ValueWithin" => "SuperDiff::RSpec::InspectionTreeBuilders::ValueWithin",
80
+ "SuperDiff::RecursionGuard" => "SuperDiff::Core::RecursionGuard",
81
+ "SuperDiff::TieredLines" => "SuperDiff::Core::TieredLines",
82
+ "SuperDiff::TieredLinesElider" => "SuperDiff::Core::TieredLinesElider",
83
+ "SuperDiff::TieredLinesFormatter" => "SuperDiff::Core::TieredLinesFormatter",
84
+ }
85
+
86
+ # stree-ignore
87
+ active_record_constant_remappings = {
88
+ "SuperDiff::ActiveRecord::ObjectInspection::InspectionTreeBuilders::ActiveRecordModel" => "SuperDiff::ActiveRecord::InspectionTreeBuilders::ActiveRecordModel",
89
+ "SuperDiff::ActiveRecord::ObjectInspection::InspectionTreeBuilders::ActiveRecordRelation" => "SuperDiff::ActiveRecord::InspectionTreeBuilders::ActiveRecordRelation",
90
+ }
91
+
92
+ # stree-ignore
93
+ active_support_constant_remappings = {
94
+ "SuperDiff::ActiveSupport::ObjectInspection::InspectionTreeBuilders::HashWithIndifferentAccess" => "SuperDiff::ActiveSupport::InspectionTreeBuilders::HashWithIndifferentAccess",
95
+ "SuperDiff::ActiveSupport::ObjectInspection::InspectionTreeBuilders::OrderedOptions" => "SuperDiff::ActiveSupport::InspectionTreeBuilders::OrderedOptions",
96
+ }
97
+
98
+ common_constant_remappings.each do |old_constant_name, new_constant_name|
99
+ RSpec.describe old_constant_name, type: :unit do
100
+ it "maps to #{new_constant_name}" do
101
+ capture_warnings do
102
+ expect(Object.const_get(old_constant_name)).to be(
103
+ Object.const_get(new_constant_name)
104
+ )
105
+ end
106
+ end
107
+
108
+ it "points users to #{new_constant_name} instead" do
109
+ expect(old_constant_name).to be_deprecated_in_favor_of(new_constant_name)
110
+ end
111
+ end
112
+ end
113
+
114
+ active_record_constant_remappings.each do |old_constant_name, new_constant_name|
115
+ RSpec.describe old_constant_name, type: :unit, active_record: true do
116
+ it "maps to #{new_constant_name}" do
117
+ capture_warnings do
118
+ expect(Object.const_get(old_constant_name)).to be(
119
+ Object.const_get(new_constant_name)
120
+ )
121
+ end
122
+ end
123
+
124
+ it "points users to #{new_constant_name} instead" do
125
+ expect(old_constant_name).to be_deprecated_in_favor_of(new_constant_name)
126
+ end
127
+ end
128
+ end
129
+
130
+ active_support_constant_remappings.each do |old_constant_name, new_constant_name|
131
+ RSpec.describe old_constant_name, type: :unit, active_support: true do
132
+ it "maps to #{new_constant_name}" do
133
+ capture_warnings do
134
+ expect(Object.const_get(old_constant_name)).to be(
135
+ Object.const_get(new_constant_name)
136
+ )
137
+ end
138
+ end
139
+
140
+ it "points users to #{new_constant_name} instead" do
141
+ expect(old_constant_name).to be_deprecated_in_favor_of(new_constant_name)
142
+ end
143
+ end
144
+ end
145
+
146
+ RSpec.describe "SuperDiff::Differs::Main.call", type: :unit do
147
+ it "maps to SuperDiff.diff" do
148
+ capture_warnings do
149
+ diff_before = SuperDiff::Differs::Main.call(1, 2)
150
+ diff_after = SuperDiff.diff(1, 2)
151
+ expect(diff_before).to eq(diff_after)
152
+ end
153
+ end
154
+ end
155
+
156
+ RSpec.describe "SuperDiff::OperationTreeBuilders::Main.call", type: :unit do
157
+ it "maps to SuperDiff.build_operation_tree_for" do
158
+ capture_warnings do
159
+ operation_tree_builder_before =
160
+ SuperDiff::OperationTreeBuilders::Main.call(1, 2)
161
+ operation_tree_builder_after = SuperDiff.build_operation_tree_for(1, 2)
162
+ expect(operation_tree_builder_before).to eq(operation_tree_builder_after)
163
+ end
164
+ end
165
+ end
166
+
167
+ RSpec.describe "SuperDiff::OperationTrees::Main.call", type: :unit do
168
+ it "maps to SuperDiff.find_operation_tree_for" do
169
+ capture_warnings do
170
+ operation_tree_before =
171
+ SuperDiff::OperationTrees::Main.call(%i[foo bar baz])
172
+ operation_tree_after = SuperDiff.find_operation_tree_for(%i[foo bar baz])
173
+ expect(operation_tree_before).to eq(operation_tree_after)
174
+ end
175
+ end
176
+ end
@@ -1598,8 +1598,8 @@ RSpec.describe SuperDiff::EqualityMatchers::Main, type: :unit do
1598
1598
 
1599
1599
  #{
1600
1600
  colored do
1601
- expected_line %(Expected: #<SuperDiff::Test::Player:#{SuperDiff::Helpers.object_address_for(expected)} @character="mirage", @handle="martymcfly", @health=0.3, @inventory=["flatline", "purple body shield"], @shields=0.6, @ultimate=0.8>)
1602
- actual_line %( Actual: #<SuperDiff::Test::Player:#{SuperDiff::Helpers.object_address_for(actual)} @character="lifeline", @handle="docbrown", @health=0.3, @inventory=["wingman", "mastiff"], @shields=0.6, @ultimate=0.8>)
1601
+ expected_line %(Expected: #<SuperDiff::Test::Player:#{SuperDiff::Core::Helpers.object_address_for(expected)} @character="mirage", @handle="martymcfly", @health=0.3, @inventory=["flatline", "purple body shield"], @shields=0.6, @ultimate=0.8>)
1602
+ actual_line %( Actual: #<SuperDiff::Test::Player:#{SuperDiff::Core::Helpers.object_address_for(actual)} @character="lifeline", @handle="docbrown", @health=0.3, @inventory=["wingman", "mastiff"], @shields=0.6, @ultimate=0.8>)
1603
1603
  end
1604
1604
  }
1605
1605
 
@@ -1607,7 +1607,7 @@ RSpec.describe SuperDiff::EqualityMatchers::Main, type: :unit do
1607
1607
 
1608
1608
  #{
1609
1609
  colored do
1610
- plain_line %( #<SuperDiff::Test::Player:#{SuperDiff::Helpers.object_address_for(actual)} {)
1610
+ plain_line %( #<SuperDiff::Test::Player:#{SuperDiff::Core::Helpers.object_address_for(actual)} {)
1611
1611
  expected_line %(- @character="mirage",)
1612
1612
  actual_line %(+ @character="lifeline",)
1613
1613
  expected_line %(- @handle="martymcfly",)
@@ -1677,8 +1677,8 @@ RSpec.describe SuperDiff::EqualityMatchers::Main, type: :unit do
1677
1677
 
1678
1678
  #{
1679
1679
  colored do
1680
- expected_line %(Expected: #<SuperDiff::Test::Item:#{SuperDiff::Helpers.object_address_for(expected)} @name="camera", @quantity=3>)
1681
- actual_line %( Actual: #<SuperDiff::Test::Player:#{SuperDiff::Helpers.object_address_for(actual)} @character="Jon", @handle="mcmire", @health=4, @inventory=["sword"], @shields=11.4, @ultimate=true>)
1680
+ expected_line %(Expected: #<SuperDiff::Test::Item:#{SuperDiff::Core::Helpers.object_address_for(expected)} @name="camera", @quantity=3>)
1681
+ actual_line %( Actual: #<SuperDiff::Test::Player:#{SuperDiff::Core::Helpers.object_address_for(actual)} @character="Jon", @handle="mcmire", @health=4, @inventory=["sword"], @shields=11.4, @ultimate=true>)
1682
1682
  end
1683
1683
  }
1684
1684
  STR
data/super_diff.gemspec CHANGED
@@ -13,6 +13,12 @@ Gem::Specification.new do |s|
13
13
  SuperDiff is a gem that hooks into RSpec to intelligently display the
14
14
  differences between two data structures of any type.
15
15
  DESC
16
+ s.metadata = {
17
+ "bug_tracker_uri" => "https://github.com/mcmire/super_diff/issues",
18
+ "changelog_uri" =>
19
+ "https://github.com/mcmire/super_diff/blob/main/CHANGELOG.md",
20
+ "source_code_uri" => "https://github.com/mcmire/super_diff"
21
+ }
16
22
  s.required_ruby_version = ">= 3"
17
23
 
18
24
  s.files = %w[README.md super_diff.gemspec] + Dir["lib/**/*"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: super_diff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elliot Winkler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-10 00:00:00.000000000 Z
11
+ date: 2024-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: attr_extras
@@ -66,11 +66,11 @@ files:
66
66
  - lib/super_diff/active_record.rb
67
67
  - lib/super_diff/active_record/differs.rb
68
68
  - lib/super_diff/active_record/differs/active_record_relation.rb
69
+ - lib/super_diff/active_record/inspection_tree_builders.rb
70
+ - lib/super_diff/active_record/inspection_tree_builders/active_record_model.rb
71
+ - lib/super_diff/active_record/inspection_tree_builders/active_record_relation.rb
69
72
  - lib/super_diff/active_record/monkey_patches.rb
70
73
  - lib/super_diff/active_record/object_inspection.rb
71
- - lib/super_diff/active_record/object_inspection/inspection_tree_builders.rb
72
- - lib/super_diff/active_record/object_inspection/inspection_tree_builders/active_record_model.rb
73
- - lib/super_diff/active_record/object_inspection/inspection_tree_builders/active_record_relation.rb
74
74
  - lib/super_diff/active_record/operation_tree_builders.rb
75
75
  - lib/super_diff/active_record/operation_tree_builders/active_record_model.rb
76
76
  - lib/super_diff/active_record/operation_tree_builders/active_record_relation.rb
@@ -81,18 +81,100 @@ files:
81
81
  - lib/super_diff/active_support.rb
82
82
  - lib/super_diff/active_support/differs.rb
83
83
  - lib/super_diff/active_support/differs/hash_with_indifferent_access.rb
84
+ - lib/super_diff/active_support/inspection_tree_builders.rb
85
+ - lib/super_diff/active_support/inspection_tree_builders/hash_with_indifferent_access.rb
86
+ - lib/super_diff/active_support/inspection_tree_builders/ordered_options.rb
84
87
  - lib/super_diff/active_support/object_inspection.rb
85
- - lib/super_diff/active_support/object_inspection/inspection_tree_builders.rb
86
- - lib/super_diff/active_support/object_inspection/inspection_tree_builders/hash_with_indifferent_access.rb
87
- - lib/super_diff/active_support/object_inspection/inspection_tree_builders/ordered_options.rb
88
88
  - lib/super_diff/active_support/operation_tree_builders.rb
89
89
  - lib/super_diff/active_support/operation_tree_builders/hash_with_indifferent_access.rb
90
90
  - lib/super_diff/active_support/operation_tree_flatteners.rb
91
91
  - lib/super_diff/active_support/operation_tree_flatteners/hash_with_indifferent_access.rb
92
92
  - lib/super_diff/active_support/operation_trees.rb
93
93
  - lib/super_diff/active_support/operation_trees/hash_with_indifferent_access.rb
94
- - lib/super_diff/colorized_document_extensions.rb
95
- - lib/super_diff/configuration.rb
94
+ - lib/super_diff/basic.rb
95
+ - lib/super_diff/basic/diff_formatters.rb
96
+ - lib/super_diff/basic/diff_formatters/collection.rb
97
+ - lib/super_diff/basic/diff_formatters/multiline_string.rb
98
+ - lib/super_diff/basic/differs.rb
99
+ - lib/super_diff/basic/differs/array.rb
100
+ - lib/super_diff/basic/differs/custom_object.rb
101
+ - lib/super_diff/basic/differs/date_like.rb
102
+ - lib/super_diff/basic/differs/default_object.rb
103
+ - lib/super_diff/basic/differs/hash.rb
104
+ - lib/super_diff/basic/differs/multiline_string.rb
105
+ - lib/super_diff/basic/differs/time_like.rb
106
+ - lib/super_diff/basic/inspection_tree_builders.rb
107
+ - lib/super_diff/basic/inspection_tree_builders/array.rb
108
+ - lib/super_diff/basic/inspection_tree_builders/custom_object.rb
109
+ - lib/super_diff/basic/inspection_tree_builders/date_like.rb
110
+ - lib/super_diff/basic/inspection_tree_builders/default_object.rb
111
+ - lib/super_diff/basic/inspection_tree_builders/hash.rb
112
+ - lib/super_diff/basic/inspection_tree_builders/primitive.rb
113
+ - lib/super_diff/basic/inspection_tree_builders/time_like.rb
114
+ - lib/super_diff/basic/operation_tree_builders.rb
115
+ - lib/super_diff/basic/operation_tree_builders/array.rb
116
+ - lib/super_diff/basic/operation_tree_builders/custom_object.rb
117
+ - lib/super_diff/basic/operation_tree_builders/date_like.rb
118
+ - lib/super_diff/basic/operation_tree_builders/default_object.rb
119
+ - lib/super_diff/basic/operation_tree_builders/hash.rb
120
+ - lib/super_diff/basic/operation_tree_builders/multiline_string.rb
121
+ - lib/super_diff/basic/operation_tree_builders/time_like.rb
122
+ - lib/super_diff/basic/operation_tree_flatteners.rb
123
+ - lib/super_diff/basic/operation_tree_flatteners/array.rb
124
+ - lib/super_diff/basic/operation_tree_flatteners/collection.rb
125
+ - lib/super_diff/basic/operation_tree_flatteners/custom_object.rb
126
+ - lib/super_diff/basic/operation_tree_flatteners/default_object.rb
127
+ - lib/super_diff/basic/operation_tree_flatteners/hash.rb
128
+ - lib/super_diff/basic/operation_tree_flatteners/multiline_string.rb
129
+ - lib/super_diff/basic/operation_trees.rb
130
+ - lib/super_diff/basic/operation_trees/array.rb
131
+ - lib/super_diff/basic/operation_trees/custom_object.rb
132
+ - lib/super_diff/basic/operation_trees/default_object.rb
133
+ - lib/super_diff/basic/operation_trees/hash.rb
134
+ - lib/super_diff/basic/operation_trees/multiline_string.rb
135
+ - lib/super_diff/core.rb
136
+ - lib/super_diff/core/abstract_differ.rb
137
+ - lib/super_diff/core/abstract_inspection_tree_builder.rb
138
+ - lib/super_diff/core/abstract_operation_tree.rb
139
+ - lib/super_diff/core/abstract_operation_tree_builder.rb
140
+ - lib/super_diff/core/abstract_operation_tree_flattener.rb
141
+ - lib/super_diff/core/binary_operation.rb
142
+ - lib/super_diff/core/colorized_document_extensions.rb
143
+ - lib/super_diff/core/configuration.rb
144
+ - lib/super_diff/core/differ_dispatcher.rb
145
+ - lib/super_diff/core/gem_version.rb
146
+ - lib/super_diff/core/helpers.rb
147
+ - lib/super_diff/core/implementation_checks.rb
148
+ - lib/super_diff/core/inspection_tree.rb
149
+ - lib/super_diff/core/inspection_tree_builder_dispatcher.rb
150
+ - lib/super_diff/core/inspection_tree_nodes.rb
151
+ - lib/super_diff/core/inspection_tree_nodes/as_lines_when_rendering_to_lines.rb
152
+ - lib/super_diff/core/inspection_tree_nodes/as_prefix_when_rendering_to_lines.rb
153
+ - lib/super_diff/core/inspection_tree_nodes/as_prelude_when_rendering_to_lines.rb
154
+ - lib/super_diff/core/inspection_tree_nodes/as_single_line.rb
155
+ - lib/super_diff/core/inspection_tree_nodes/base.rb
156
+ - lib/super_diff/core/inspection_tree_nodes/inspection.rb
157
+ - lib/super_diff/core/inspection_tree_nodes/nesting.rb
158
+ - lib/super_diff/core/inspection_tree_nodes/only_when.rb
159
+ - lib/super_diff/core/inspection_tree_nodes/text.rb
160
+ - lib/super_diff/core/inspection_tree_nodes/when_empty.rb
161
+ - lib/super_diff/core/inspection_tree_nodes/when_non_empty.rb
162
+ - lib/super_diff/core/inspection_tree_nodes/when_rendering_to_lines.rb
163
+ - lib/super_diff/core/inspection_tree_nodes/when_rendering_to_string.rb
164
+ - lib/super_diff/core/line.rb
165
+ - lib/super_diff/core/no_differ_available_error.rb
166
+ - lib/super_diff/core/no_inspection_tree_builder_available_error.rb
167
+ - lib/super_diff/core/no_operation_tree_available_error.rb
168
+ - lib/super_diff/core/no_operation_tree_builder_available_error.rb
169
+ - lib/super_diff/core/operation_tree_builder_dispatcher.rb
170
+ - lib/super_diff/core/operation_tree_finder.rb
171
+ - lib/super_diff/core/prefix_for_next_inspection_tree_node.rb
172
+ - lib/super_diff/core/prelude_for_next_inspection_tree_node.rb
173
+ - lib/super_diff/core/recursion_guard.rb
174
+ - lib/super_diff/core/tiered_lines.rb
175
+ - lib/super_diff/core/tiered_lines_elider.rb
176
+ - lib/super_diff/core/tiered_lines_formatter.rb
177
+ - lib/super_diff/core/unary_operation.rb
96
178
  - lib/super_diff/csi.rb
97
179
  - lib/super_diff/csi/bold_sequence.rb
98
180
  - lib/super_diff/csi/color.rb
@@ -104,20 +186,7 @@ files:
104
186
  - lib/super_diff/csi/reset_sequence.rb
105
187
  - lib/super_diff/csi/twenty_four_bit_color.rb
106
188
  - lib/super_diff/csi/uncolorized_document.rb
107
- - lib/super_diff/diff_formatters/collection.rb
108
- - lib/super_diff/diff_formatters/multiline_string.rb
109
189
  - lib/super_diff/differs.rb
110
- - lib/super_diff/differs/array.rb
111
- - lib/super_diff/differs/base.rb
112
- - lib/super_diff/differs/custom_object.rb
113
- - lib/super_diff/differs/date_like.rb
114
- - lib/super_diff/differs/default_object.rb
115
- - lib/super_diff/differs/defaults.rb
116
- - lib/super_diff/differs/empty.rb
117
- - lib/super_diff/differs/hash.rb
118
- - lib/super_diff/differs/main.rb
119
- - lib/super_diff/differs/multiline_string.rb
120
- - lib/super_diff/differs/time_like.rb
121
190
  - lib/super_diff/equality_matchers.rb
122
191
  - lib/super_diff/equality_matchers/array.rb
123
192
  - lib/super_diff/equality_matchers/base.rb
@@ -129,73 +198,12 @@ files:
129
198
  - lib/super_diff/equality_matchers/primitive.rb
130
199
  - lib/super_diff/equality_matchers/singleline_string.rb
131
200
  - lib/super_diff/errors.rb
132
- - lib/super_diff/errors/no_differ_available_error.rb
133
- - lib/super_diff/gem_version.rb
134
- - lib/super_diff/helpers.rb
135
- - lib/super_diff/implementation_checks.rb
136
- - lib/super_diff/line.rb
137
201
  - lib/super_diff/object_inspection.rb
138
- - lib/super_diff/object_inspection/inspection_tree.rb
139
- - lib/super_diff/object_inspection/inspection_tree_builders.rb
140
- - lib/super_diff/object_inspection/inspection_tree_builders/array.rb
141
- - lib/super_diff/object_inspection/inspection_tree_builders/base.rb
142
- - lib/super_diff/object_inspection/inspection_tree_builders/custom_object.rb
143
- - lib/super_diff/object_inspection/inspection_tree_builders/date_like.rb
144
- - lib/super_diff/object_inspection/inspection_tree_builders/default_object.rb
145
- - lib/super_diff/object_inspection/inspection_tree_builders/defaults.rb
146
- - lib/super_diff/object_inspection/inspection_tree_builders/hash.rb
147
- - lib/super_diff/object_inspection/inspection_tree_builders/main.rb
148
- - lib/super_diff/object_inspection/inspection_tree_builders/primitive.rb
149
- - lib/super_diff/object_inspection/inspection_tree_builders/time_like.rb
150
- - lib/super_diff/object_inspection/nodes.rb
151
- - lib/super_diff/object_inspection/nodes/as_lines_when_rendering_to_lines.rb
152
- - lib/super_diff/object_inspection/nodes/as_prefix_when_rendering_to_lines.rb
153
- - lib/super_diff/object_inspection/nodes/as_prelude_when_rendering_to_lines.rb
154
- - lib/super_diff/object_inspection/nodes/as_single_line.rb
155
- - lib/super_diff/object_inspection/nodes/base.rb
156
- - lib/super_diff/object_inspection/nodes/inspection.rb
157
- - lib/super_diff/object_inspection/nodes/nesting.rb
158
- - lib/super_diff/object_inspection/nodes/only_when.rb
159
- - lib/super_diff/object_inspection/nodes/text.rb
160
- - lib/super_diff/object_inspection/nodes/when_empty.rb
161
- - lib/super_diff/object_inspection/nodes/when_non_empty.rb
162
- - lib/super_diff/object_inspection/nodes/when_rendering_to_lines.rb
163
- - lib/super_diff/object_inspection/nodes/when_rendering_to_string.rb
164
- - lib/super_diff/object_inspection/prefix_for_next_node.rb
165
- - lib/super_diff/object_inspection/prelude_for_next_node.rb
166
202
  - lib/super_diff/operation_tree_builders.rb
167
- - lib/super_diff/operation_tree_builders/array.rb
168
- - lib/super_diff/operation_tree_builders/base.rb
169
- - lib/super_diff/operation_tree_builders/custom_object.rb
170
- - lib/super_diff/operation_tree_builders/date_like.rb
171
- - lib/super_diff/operation_tree_builders/default_object.rb
172
- - lib/super_diff/operation_tree_builders/defaults.rb
173
- - lib/super_diff/operation_tree_builders/hash.rb
174
- - lib/super_diff/operation_tree_builders/main.rb
175
- - lib/super_diff/operation_tree_builders/multiline_string.rb
176
- - lib/super_diff/operation_tree_builders/time_like.rb
177
203
  - lib/super_diff/operation_tree_flatteners.rb
178
- - lib/super_diff/operation_tree_flatteners/array.rb
179
- - lib/super_diff/operation_tree_flatteners/base.rb
180
- - lib/super_diff/operation_tree_flatteners/collection.rb
181
- - lib/super_diff/operation_tree_flatteners/custom_object.rb
182
- - lib/super_diff/operation_tree_flatteners/default_object.rb
183
- - lib/super_diff/operation_tree_flatteners/hash.rb
184
- - lib/super_diff/operation_tree_flatteners/multiline_string.rb
185
204
  - lib/super_diff/operation_trees.rb
186
- - lib/super_diff/operation_trees/array.rb
187
- - lib/super_diff/operation_trees/base.rb
188
- - lib/super_diff/operation_trees/custom_object.rb
189
- - lib/super_diff/operation_trees/default_object.rb
190
- - lib/super_diff/operation_trees/defaults.rb
191
- - lib/super_diff/operation_trees/hash.rb
192
- - lib/super_diff/operation_trees/main.rb
193
- - lib/super_diff/operation_trees/multiline_string.rb
194
205
  - lib/super_diff/operations.rb
195
- - lib/super_diff/operations/binary_operation.rb
196
- - lib/super_diff/operations/unary_operation.rb
197
206
  - lib/super_diff/rails.rb
198
- - lib/super_diff/recursion_guard.rb
199
207
  - lib/super_diff/rspec-rails.rb
200
208
  - lib/super_diff/rspec.rb
201
209
  - lib/super_diff/rspec/augmented_matcher.rb
@@ -205,6 +213,17 @@ files:
205
213
  - lib/super_diff/rspec/differs/collection_including.rb
206
214
  - lib/super_diff/rspec/differs/hash_including.rb
207
215
  - lib/super_diff/rspec/differs/object_having_attributes.rb
216
+ - lib/super_diff/rspec/inspection_tree_builders.rb
217
+ - lib/super_diff/rspec/inspection_tree_builders/collection_containing_exactly.rb
218
+ - lib/super_diff/rspec/inspection_tree_builders/collection_including.rb
219
+ - lib/super_diff/rspec/inspection_tree_builders/double.rb
220
+ - lib/super_diff/rspec/inspection_tree_builders/generic_describable_matcher.rb
221
+ - lib/super_diff/rspec/inspection_tree_builders/hash_including.rb
222
+ - lib/super_diff/rspec/inspection_tree_builders/instance_of.rb
223
+ - lib/super_diff/rspec/inspection_tree_builders/kind_of.rb
224
+ - lib/super_diff/rspec/inspection_tree_builders/object_having_attributes.rb
225
+ - lib/super_diff/rspec/inspection_tree_builders/primitive.rb
226
+ - lib/super_diff/rspec/inspection_tree_builders/value_within.rb
208
227
  - lib/super_diff/rspec/matcher_text_builders.rb
209
228
  - lib/super_diff/rspec/matcher_text_builders/base.rb
210
229
  - lib/super_diff/rspec/matcher_text_builders/be_predicate.rb
@@ -216,25 +235,11 @@ files:
216
235
  - lib/super_diff/rspec/matcher_text_template.rb
217
236
  - lib/super_diff/rspec/monkey_patches.rb
218
237
  - lib/super_diff/rspec/object_inspection.rb
219
- - lib/super_diff/rspec/object_inspection/inspection_tree_builders.rb
220
- - lib/super_diff/rspec/object_inspection/inspection_tree_builders/collection_containing_exactly.rb
221
- - lib/super_diff/rspec/object_inspection/inspection_tree_builders/collection_including.rb
222
- - lib/super_diff/rspec/object_inspection/inspection_tree_builders/double.rb
223
- - lib/super_diff/rspec/object_inspection/inspection_tree_builders/generic_describable_matcher.rb
224
- - lib/super_diff/rspec/object_inspection/inspection_tree_builders/hash_including.rb
225
- - lib/super_diff/rspec/object_inspection/inspection_tree_builders/instance_of.rb
226
- - lib/super_diff/rspec/object_inspection/inspection_tree_builders/kind_of.rb
227
- - lib/super_diff/rspec/object_inspection/inspection_tree_builders/object_having_attributes.rb
228
- - lib/super_diff/rspec/object_inspection/inspection_tree_builders/primitive.rb
229
- - lib/super_diff/rspec/object_inspection/inspection_tree_builders/value_within.rb
230
238
  - lib/super_diff/rspec/operation_tree_builders.rb
231
239
  - lib/super_diff/rspec/operation_tree_builders/collection_containing_exactly.rb
232
240
  - lib/super_diff/rspec/operation_tree_builders/collection_including.rb
233
241
  - lib/super_diff/rspec/operation_tree_builders/hash_including.rb
234
242
  - lib/super_diff/rspec/operation_tree_builders/object_having_attributes.rb
235
- - lib/super_diff/tiered_lines.rb
236
- - lib/super_diff/tiered_lines_elider.rb
237
- - lib/super_diff/tiered_lines_formatter.rb
238
243
  - lib/super_diff/version.rb
239
244
  - spec/examples.txt
240
245
  - spec/integration/rails/active_record_spec.rb
@@ -290,16 +295,20 @@ files:
290
295
  - spec/support/shared_examples/hash_with_indifferent_access.rb
291
296
  - spec/support/shared_examples/key.rb
292
297
  - spec/support/unit/helpers.rb
298
+ - spec/support/unit/matchers/be_deprecated_in_favor_of.rb
293
299
  - spec/support/unit/matchers/match_output.rb
294
300
  - spec/unit/active_record/object_inspection_spec.rb
295
301
  - spec/unit/active_support/object_inspection_spec.rb
302
+ - spec/unit/basic/operation_tree_flatteners/array_spec.rb
303
+ - spec/unit/basic/operation_tree_flatteners/custom_object_spec.rb
304
+ - spec/unit/basic/operation_tree_flatteners/default_object_spec.rb
305
+ - spec/unit/basic/operation_tree_flatteners/hash_spec.rb
306
+ - spec/unit/basic/operation_tree_flatteners/multiline_string_spec.rb
307
+ - spec/unit/core/helpers_spec.rb
308
+ - spec/unit/core/tiered_lines_elider_spec.rb
309
+ - spec/unit/core/tiered_lines_formatter_spec.rb
310
+ - spec/unit/deprecations_spec.rb
296
311
  - spec/unit/equality_matchers/main_spec.rb
297
- - spec/unit/helpers_spec.rb
298
- - spec/unit/operation_tree_flatteners/array_spec.rb
299
- - spec/unit/operation_tree_flatteners/custom_object_spec.rb
300
- - spec/unit/operation_tree_flatteners/default_object_spec.rb
301
- - spec/unit/operation_tree_flatteners/hash_spec.rb
302
- - spec/unit/operation_tree_flatteners/multiline_string_spec.rb
303
312
  - spec/unit/rspec/matchers/be_compared_to_spec.rb
304
313
  - spec/unit/rspec/matchers/be_falsey_spec.rb
305
314
  - spec/unit/rspec/matchers/be_nil_spec.rb
@@ -318,13 +327,14 @@ files:
318
327
  - spec/unit/rspec/object_inspection/rspec_matcher_spec.rb
319
328
  - spec/unit/rspec/object_inspection_spec.rb
320
329
  - spec/unit/super_diff_spec.rb
321
- - spec/unit/tiered_lines_elider_spec.rb
322
- - spec/unit/tiered_lines_formatter_spec.rb
323
330
  - super_diff.gemspec
324
331
  homepage: https://github.com/mcmire/super_diff
325
332
  licenses:
326
333
  - MIT
327
- metadata: {}
334
+ metadata:
335
+ bug_tracker_uri: https://github.com/mcmire/super_diff/issues
336
+ changelog_uri: https://github.com/mcmire/super_diff/blob/main/CHANGELOG.md
337
+ source_code_uri: https://github.com/mcmire/super_diff
328
338
  post_install_message:
329
339
  rdoc_options: []
330
340
  require_paths:
@@ -399,16 +409,20 @@ test_files:
399
409
  - spec/support/shared_examples/hash_with_indifferent_access.rb
400
410
  - spec/support/shared_examples/key.rb
401
411
  - spec/support/unit/helpers.rb
412
+ - spec/support/unit/matchers/be_deprecated_in_favor_of.rb
402
413
  - spec/support/unit/matchers/match_output.rb
403
414
  - spec/unit/active_record/object_inspection_spec.rb
404
415
  - spec/unit/active_support/object_inspection_spec.rb
416
+ - spec/unit/basic/operation_tree_flatteners/array_spec.rb
417
+ - spec/unit/basic/operation_tree_flatteners/custom_object_spec.rb
418
+ - spec/unit/basic/operation_tree_flatteners/default_object_spec.rb
419
+ - spec/unit/basic/operation_tree_flatteners/hash_spec.rb
420
+ - spec/unit/basic/operation_tree_flatteners/multiline_string_spec.rb
421
+ - spec/unit/core/helpers_spec.rb
422
+ - spec/unit/core/tiered_lines_elider_spec.rb
423
+ - spec/unit/core/tiered_lines_formatter_spec.rb
424
+ - spec/unit/deprecations_spec.rb
405
425
  - spec/unit/equality_matchers/main_spec.rb
406
- - spec/unit/helpers_spec.rb
407
- - spec/unit/operation_tree_flatteners/array_spec.rb
408
- - spec/unit/operation_tree_flatteners/custom_object_spec.rb
409
- - spec/unit/operation_tree_flatteners/default_object_spec.rb
410
- - spec/unit/operation_tree_flatteners/hash_spec.rb
411
- - spec/unit/operation_tree_flatteners/multiline_string_spec.rb
412
426
  - spec/unit/rspec/matchers/be_compared_to_spec.rb
413
427
  - spec/unit/rspec/matchers/be_falsey_spec.rb
414
428
  - spec/unit/rspec/matchers/be_nil_spec.rb
@@ -427,5 +441,3 @@ test_files:
427
441
  - spec/unit/rspec/object_inspection/rspec_matcher_spec.rb
428
442
  - spec/unit/rspec/object_inspection_spec.rb
429
443
  - spec/unit/super_diff_spec.rb
430
- - spec/unit/tiered_lines_elider_spec.rb
431
- - spec/unit/tiered_lines_formatter_spec.rb
@@ -1,51 +0,0 @@
1
- module SuperDiff
2
- module ActiveRecord
3
- module ObjectInspection
4
- module InspectionTreeBuilders
5
- class ActiveRecordModel < SuperDiff::ObjectInspection::InspectionTreeBuilders::Base
6
- def self.applies_to?(value)
7
- value.is_a?(::ActiveRecord::Base)
8
- end
9
-
10
- def call
11
- SuperDiff::ObjectInspection::InspectionTree.new do |t1|
12
- t1.as_lines_when_rendering_to_lines(
13
- collection_bookend: :open
14
- ) do |t2|
15
- t2.add_text "#<#{object.class} "
16
-
17
- # stree-ignore
18
- t2.when_rendering_to_lines do |t3|
19
- t3.add_text "{"
20
- end
21
- end
22
-
23
- t1.nested do |t2|
24
- t2.insert_separated_list(
25
- ["id"] + (object.attributes.keys.sort - ["id"])
26
- ) do |t3, name|
27
- t3.as_prefix_when_rendering_to_lines do |t4|
28
- t4.add_text "#{name}: "
29
- end
30
-
31
- t3.add_inspection_of object.read_attribute(name)
32
- end
33
- end
34
-
35
- t1.as_lines_when_rendering_to_lines(
36
- collection_bookend: :close
37
- ) do |t2|
38
- # stree-ignore
39
- t2.when_rendering_to_lines do |t3|
40
- t3.add_text "}"
41
- end
42
-
43
- t2.add_text ">"
44
- end
45
- end
46
- end
47
- end
48
- end
49
- end
50
- end
51
- end