fix: Require vector2d 3.0 - #149
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A hard floor rather than a permissive
[">= 2.3", "< 4.0"]. Both genuinely work —mainpasses on 2.3.0 and 3.0.0 alike — but the wider bound is mutually exclusive with the cleanup below, sinceVector2d#fit(upscale:)is a 3.0 API and the suite fails 93 examples against 2.3.With the floor in place,
ImageSizing#fitno longer clamps upscaling by hand: the privatecontainhelper collapses intoscale, 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@examplevalue shifts from Float to Integer; the other three are unchanged.Verified on 3.0.0 against current
main(including #148, which renders exactly whatfitreturns): 601 examples, 0 failures on SQLite and PostgreSQL, rubocop clean, no warnings under-W:deprecated.Closes #141