Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

Gem::Platform#===

===(other)

Does other match this platform? Two platforms match if they have the same CPU, or either has a CPU of ‘universal’, they have the same OS, and 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).

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 as a wildcard for a binary gem platform (as for other OSes), for the runtime platform “no version” stands for ‘gnu’. To be able to distinguish these, the method receiver is the gem platform, while the argument is the runtime platform.

See also #== #=~ .sort_priority #eql? also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0