I noticed in platform.rb we have what appears to a redundant regular expression and some things that are too strict. Regarding the redundant regex I see this on line 75-76 of platform.rb:
when /^dotnet$/ then [ 'dotnet', nil ]
when /^dotnet([\d.]*)/ then [ 'dotnet', $1 ]
What case does the first one cover that the second one doesn't?
Also, it seems the regexen for aix, freebsd, hpux, openbsd and solaris are too strict. If no version is specified the os will come back as "unknown". For example:
=> Gem::Platform:0x85988c @cpu="universal", @os="solaris", @version="10.2"
=> Gem::Platform:0x857780 @cpu="universal", @os="unknown", @version=nil
Other platforms allow an OS to be set with a nil version. Why not those? I can get around it manually, but would rather not have to. I would suggest that these be modified to make the digits optional as they currently are for darwin.
I think the regexp idea is broken and should only be used to normalize recognized compatible platforms, unrecognized platforms should be passed through unmolested.
It would seem that the preferred way is to use a two-element array instead of a string. That approach does seem to pass the platform through unmolested, and also has the advantage of setting the version to nil.
This appears to have been fixed at some point. Closing.