Skip to content

fix: Require vector2d 3.0 - #149

Merged
elektronaut merged 1 commit into
mainfrom
vector2d-3.0-handoff
Sep 20, 2026
Merged

elektronaut merged 1 commit into
mainfrom
vector2d-3.0-handoff

Conversation

@elektronaut

Copy link
Copy Markdown
Owner

A hard floor rather than a permissive [">= 2.3", "< 4.0"]. Both genuinely work — main passes on 2.3.0 and 3.0.0 alike — but the wider bound is mutually exclusive with the cleanup below, since Vector2d#fit(upscale:) is a 3.0 API and the suite fails 93 examples against 2.3.

With the floor in place, ImageSizing#fit no longer clamps upscaling by hand: the private contain helper collapses into scale, which hands both the crop and non-crop paths to vector2d. Where the clamp fires the rewrite returns the record's own vector instead of scaling up and back down, so one @example value shifts from Float to Integer; the other three are unchanged.

Verified on 3.0.0 against current main (including #148, which renders exactly what fit returns): 601 examples, 0 failures on SQLite and PostgreSQL, rubocop clean, no warnings under -W:deprecated.

Closes #141

Move the pin to a hard floor rather than a permissive
[">= 2.3", "< 4.0"]. Current main runs on both 2.3.0 and 3.0.0, so the
wider bound genuinely works, but it is mutually exclusive with the
ImageSizing cleanup below: Vector2d#fit(upscale:) is a 3.0 API and the
suite fails 93 examples against 2.3.

With that floor in place, ImageSizing#fit no longer has to clamp
upscaling by hand. The private contain helper collapses into scale,
which delegates both the crop and non-crop paths to vector2d.

Where the clamp fires, the rewrite returns the record's own vector
instead of scaling up and back down, so one docstring example shifts
from Float to Integer. The other three are unchanged.

Closes #141
@elektronaut
elektronaut merged commit 1756cb8 into main Sep 20, 2026
6 checks passed
@elektronaut
elektronaut deleted the vector2d-3.0-handoff branch September 20, 2026 16:38
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.

ImageSizing#fit can drop its private contain helper once vector2d 3.0 ships

1 participant