We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello!
When a Ruby gem version is a pre-release it generally uses a . as the separator between major, minor, patch and the pre release info.
.
For example:
v1.0.0.rc.1
For more info on the expected patterns you can see https://guides.rubygems.org/patterns/#prerelease-gems.
From what I can see, NewVersion does not accept this as valid.
NewVersion
Given that the function stars it will take a semver-ish string and coerce it in to a valid SemVer I would have expect the above example to work.
Would you be interested in supporting this in your library?
I’d be happy to work on a PR. I’ve not properly looked but it could be as simple as updating the versionRegex.
The following matches either . Or - in group 4.
v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?((-|\.)([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?
Edit:
This regex works
v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?((?:-|\.)([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?
Thank you for taking the time to maintain such a useful library!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello!
When a Ruby gem version is a pre-release it generally uses a
.
as the separator between major, minor, patch and the pre release info.For example:
v1.0.0.rc.1
For more info on the expected patterns you can see https://guides.rubygems.org/patterns/#prerelease-gems.
From what I can see,
NewVersion
does not accept this as valid.Given that the function stars it will take a semver-ish string and coerce it in to a valid SemVer I would have expect the above example to work.
Would you be interested in supporting this in your library?
I’d be happy to work on a PR. I’ve not properly looked but it could be as simple as updating the versionRegex.
The following matches either . Or - in group 4.
v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?((-|\.)([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?
Edit:
This regex works
v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?((?:-|\.)([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?
Thank you for taking the time to maintain such a useful library!
The text was updated successfully, but these errors were encountered: