Skip to content

rubygems is not semver #5

Description

@oliverchang

e.g. rails: https://rubygems.org/gems/rails/versions/6.1.3.2

I see you try to coerce this into a semver:

https://github.com/nexB/univers/blob/63bd5aec16ec95b5b811ede638ac225f3ab1f6c6/src/univers/versions.py#L107

but this isn't correct, because it gets coerced to "6.1.3+2". and the "+2" part is not considered for ordering purposes per https://semver.org/spec/v2.0.0.html#spec-item-11

>>> SemverVersion('6.1.3.2') < SemverVersion('6.1.3.3')
False

See also https://snyk.io/blog/differences-in-version-handling-gems-and-npm/ for more issues with trying to handle ruby versions as semver.

Other ecosystems may have similar problems. E.g. composer recommends following semver, but it also doesn't enforce it: https://getcomposer.org/doc/articles/versions.md

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions