microsoft / microsoft/component-detection
Ruby gem versions don't follow pure semantic versioning
- Dominant language
- C#
- Stars
- 553
- Forks
- 135
- Avg merge
- 20h 58m
- Merged PRs (30d)
- 6
Description
Ruby gems use a slight variation on the [Semantic Versioning](https://semver.org/) specification. In Semantic Versioning, the pre-release specifier is provided after the dash (`-`). However, for Ruby gems, the platform and OS are placed after the dash and pre-releases are specified by using non-numerical characters in the version's core components.
For example, `2.0.0.a` is the pre-release version `a` of the `2.0.0` version.
The particular issue I am running into is that `nokogiri` version `1.18.9-x86_64-linux-gnu` is being treated as less-than `1.18.9`. However, the `-x86_64-linux-gnu` string is not part of version string and should be ignored for version comparison.
Source: https://guides.rubygems.org/patterns/#semantic-versioning
Note: I am not a Ruby expert. I am just using `jekyll` to build docs. While I believe what I wrote is accurate, it would be good to double check.
Contributor guide
Research direction
Start by locating the RubyGems version parsing and comparison entry point in the component detector, then reproduce comparisons involving nokogiri 1.18.9-x86_64-linux-gnu and 1.18.9. Confirm how prerelease versions such as 2.0.0.a are handled. Done means the platform suffix no longer affects ordering while Ruby gem prerelease behavior remains correct, with regression coverage added.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100