summaryrefslogtreecommitdiff
path: root/lib/rubygems/platform.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/platform.rb')
-rw-r--r--lib/rubygems/platform.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb
index 48b7344aee..450c214167 100644
--- a/lib/rubygems/platform.rb
+++ b/lib/rubygems/platform.rb
@@ -12,9 +12,10 @@ class Gem::Platform
attr_accessor :cpu, :os, :version
- def self.local
- @local ||= begin
- arch = RbConfig::CONFIG["arch"]
+ def self.local(refresh: false)
+ return @local if @local && !refresh
+ @local = begin
+ arch = Gem.target_rbconfig["arch"]
arch = "#{arch}_60" if /mswin(?:32|64)$/.match?(arch)
new(arch)
end
@@ -134,6 +135,7 @@ class Gem::Platform
when /netbsdelf/ then ["netbsdelf", nil]
when /openbsd(\d+\.\d+)?/ then ["openbsd", $1]
when /solaris(\d+\.\d+)?/ then ["solaris", $1]
+ when /wasi/ then ["wasi", nil]
# test
when /^(\w+_platform)(\d+)?/ then [$1, $2]
else ["unknown", nil]
@@ -175,7 +177,7 @@ class Gem::Platform
# they have the same version, or either one has no version
#
# Additionally, the platform will match if the local CPU is 'arm' and the
- # other CPU starts with "arm" (for generic ARM family support).
+ # other CPU starts with "armv" (for generic 32-bit ARM family support).
#
# Of note, this method is not commutative. Indeed the OS 'linux' has a
# special case: the version is the libc name, yet while "no version" stands
@@ -196,7 +198,7 @@ class Gem::Platform
# cpu
([nil,"universal"].include?(@cpu) || [nil, "universal"].include?(other.cpu) || @cpu == other.cpu ||
- (@cpu == "arm" && other.cpu.start_with?("arm"))) &&
+ (@cpu == "arm" && other.cpu.start_with?("armv"))) &&
# os
@os == other.os &&