mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[rubygems/rubygems] Restore treating "--" as an unknown platform
Rather than crashing when parsing it.
aa0064e4c7
This commit is contained in:
parent
45b53c0be1
commit
851a3e7724
2 changed files with 3 additions and 1 deletions
|
@ -90,7 +90,7 @@ class Gem::Platform
|
||||||
when String then
|
when String then
|
||||||
cpu, os = arch.sub(/-+$/, "").split("-", 2)
|
cpu, os = arch.sub(/-+$/, "").split("-", 2)
|
||||||
|
|
||||||
@cpu = if cpu.match?(/i\d86/)
|
@cpu = if cpu&.match?(/i\d86/)
|
||||||
"x86"
|
"x86"
|
||||||
else
|
else
|
||||||
cpu
|
cpu
|
||||||
|
|
|
@ -162,6 +162,8 @@ class TestGemPlatform < Gem::TestCase
|
||||||
"x86_64-dotnetx86" => ["x86_64", "dotnet", nil],
|
"x86_64-dotnetx86" => ["x86_64", "dotnet", nil],
|
||||||
"x86_64-dalvik0" => ["x86_64", "dalvik", "0"],
|
"x86_64-dalvik0" => ["x86_64", "dalvik", "0"],
|
||||||
"x86_64-dotnet1." => ["x86_64", "dotnet", "1"],
|
"x86_64-dotnet1." => ["x86_64", "dotnet", "1"],
|
||||||
|
|
||||||
|
"--" => [nil, "unknown", nil],
|
||||||
}
|
}
|
||||||
|
|
||||||
test_cases.each do |arch, expected|
|
test_cases.each do |arch, expected|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue