Skip to content

Create CODE_OF_CONDUCT.md - #4

Merged
donv merged 1 commit into
masterfrom
add-code-of-conduct-1
Mar 31, 2018
Merged

Create CODE_OF_CONDUCT.md#4
donv merged 1 commit into
masterfrom
add-code-of-conduct-1

Conversation

@donv

@donv donv commented Mar 31, 2018

Copy link
Copy Markdown
Collaborator

No description provided.

@donv
donv merged commit f5f8039 into master Mar 31, 2018
@donv
donv deleted the add-code-of-conduct-1 branch March 31, 2018 23:00
pftg added a commit that referenced this pull request Aug 22, 2026
Extends the existing DriverContractTests shared module (test/support/driver_contract_tests.rb)
with tests that pin the current de-facto driver interface shared by ChunkyPNGDriver and
VipsDriver, run against both via the shared module:

- method presence/arity for the ~15-method shared surface (load_images, add_black_box,
  find_difference_region, crop, from_file, save_image_to, resize_image_to, draw_rectangles,
  same_pixels?, same_dimension?, height_for, width_for, image_area_size, dimension, supports?)
- load_images behavior (loads both images, dimensions comparable)
- find_difference_region result shape (Difference exposing region/meta/comparison)
- dimension handling (same_dimension? true/false, width/height/dimension/area_size agreement)
- same-image fast paths (same_pixels? true/false)
- option handling: tolerance, color_distance_limit, skip_area (both drivers support these
  identically; thresholds chosen with headroom on both drivers' measured values)
- error behavior on missing base/new image files (ArgumentError)

No production code changed. No driver method renames (dissent #4 in the v2 architecture
design excludes those from this PR).
pftg added a commit that referenced this pull request Aug 22, 2026
* refactor: extract SnapDiff::Driver mixin from BaseDriver

BaseDriver's shared defaults (same_dimension?, dimension, width_for,
height_for, image_area_size, supports?, PNG_EXTENSION) move verbatim
into the SnapDiff::Driver module; BaseDriver becomes a shell that
includes it. Behavior-preserving; method names unchanged (v2 design
dissent #4).

* refactor: move concrete drivers to SnapDiff::Drivers, include Driver mixin

VipsDriver and ChunkyPNGDriver move to lib/snap_diff/drivers/ with
'include SnapDiff::Driver' replacing '< BaseDriver'. Class and method
names unchanged (v2 design dissent #4). Old namespace forwards
same-object: Drivers is a whole-module alias (covering .for and the
lazily-required driver constants), BaseDriver aliases the mixin, and
the old driver require paths stay loadable. Utils.find_driver_class_for
now requires/returns the SnapDiff paths. Namespace forwarding test
gains the 4 new pairs (25 total), vips pair skipping on vips-less
runners.

* test: rescue RuntimeError in vips-less forwarding guard (review F1)

vips_driver.rb re-raises the missing-gem LoadError as RuntimeError, so the
LoadError-only rescue let a vips-less run crash at file load instead of
skipping the vips pairs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant