Hi,

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:

irb(main):001:0> Gem::Platform.new("universal-solaris10.2")
=> #<Gem::Platform:0x85988c @cpu="universal", @os="solaris", @version="10.2">

irb(main):002:0> Gem::Platform.new("universal-solaris")
=> #<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.

Regards,

Dan
_______________________________________________
Rubygems-developers mailing list
http://rubyforge.org/projects/rubygems
Rubygems-developers@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers

Reply via email to