mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
[rubygems/rubygems] Restore treating "--" as an unknown platform
Rather than crashing when parsing it. https://github.com/rubygems/rubygems/commit/aa0064e4c7
This commit is contained in:
parent
45b53c0be1
commit
851a3e7724
@ -90,7 +90,7 @@ class Gem::Platform
|
||||
when String then
|
||||
cpu, os = arch.sub(/-+$/, "").split("-", 2)
|
||||
|
||||
@cpu = if cpu.match?(/i\d86/)
|
||||
@cpu = if cpu&.match?(/i\d86/)
|
||||
"x86"
|
||||
else
|
||||
cpu
|
||||
|
||||
@ -162,6 +162,8 @@ class TestGemPlatform < Gem::TestCase
|
||||
"x86_64-dotnetx86" => ["x86_64", "dotnet", nil],
|
||||
"x86_64-dalvik0" => ["x86_64", "dalvik", "0"],
|
||||
"x86_64-dotnet1." => ["x86_64", "dotnet", "1"],
|
||||
|
||||
"--" => [nil, "unknown", nil],
|
||||
}
|
||||
|
||||
test_cases.each do |arch, expected|
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user