Skip to content

Use prerelease aware version comparison - #157

Merged
mperham merged 1 commit into
mperham:masterfrom
deivid-rodriguez:better_version_compare
Nov 29, 2021
Merged

mperham merged 1 commit into
mperham:masterfrom
deivid-rodriguez:better_version_compare

Conversation

@deivid-rodriguez

Copy link
Copy Markdown
Contributor

The problem is:

irb(main):001:0> "2.7.0.preview1" >= "2.7.0"
=> true
irb(main):002:0> Gem::Version.new("2.7.0.preview1") >= Gem::Version.new("2.7.0")
=> false

This is very minor, and will only solve actual issues when using old prereleases of ruby, which is not great anyways (users should upgrade). But I guess it sets a standard in the code, so that if further checks like this are added in the future, they are done like this, in a way that respects prereleases.

@mperham
mperham merged commit 204d9f2 into mperham:master Nov 29, 2021
@deivid-rodriguez
deivid-rodriguez deleted the better_version_compare branch November 29, 2021 16:24
@deivid-rodriguez

Copy link
Copy Markdown
Contributor Author

Thanks!

@mperham

mperham commented Nov 29, 2021 via email

Copy link
Copy Markdown
Owner

mperham added a commit that referenced this pull request Dec 1, 2021
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