Skip to content

Rewrite "version: nearest" to require no maintenance#3906

Merged
kddnewton merged 1 commit intoruby:mainfrom
Earlopain:version-nearest-less-maintenance
Feb 4, 2026
Merged

Rewrite "version: nearest" to require no maintenance#3906
kddnewton merged 1 commit intoruby:mainfrom
Earlopain:version-nearest-less-maintenance

Conversation

@Earlopain
Copy link
Collaborator

Currently I see myself not updating this when a new version is added.

Instead, rewrite it to just work with new versions:

  • Try to set the version
  • If that doesn't succeed, check if it is lower
  • If it isn't lower, it must be higher

We can then use PM_OPTIONS_VERSION_LATEST which doesn't need to change.

Also added a very basic test.

@Earlopain Earlopain force-pushed the version-nearest-less-maintenance branch from 325a413 to 7394957 Compare February 4, 2026 13:29
Currently I see myself not updating this when a new version is added.

Instead, rewrite it to just work with new versions:
* Try to set the version
* If that doesn't succeed, check if it is lower
* If it isn't lower, it must be higher

We can then use `PM_OPTIONS_VERSION_LATEST` which doesn't need to change.

Also added a very basic test.
@Earlopain Earlopain force-pushed the version-nearest-less-maintenance branch from 7394957 to 443e9b9 Compare February 4, 2026 13:31
Copy link
Collaborator

@kddnewton kddnewton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clever!

@kddnewton kddnewton merged commit 41a65d9 into ruby:main Feb 4, 2026
67 checks passed
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.

2 participants