Available list of platforms for targeting Gem installations.

See ‘gem help platform` for information on platform matching.

Constants

A platform-specific gem that is built for the packaging Ruby’s platform. This will be replaced with Gem::Platform::local.

No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available

A pure-Ruby gem that may use Gem::Specification#extensions to build binary files.

No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
Attributes

cpu

Read & Write
No documentation available

os

Read & Write
No documentation available
Read & Write
No documentation available
Class Methods
No documentation available

Returns the generic platform for the given platform.

No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available

Returns the platform specificity match for the given spec platform and user platform.

No documentation available
No documentation available

Sorts and filters the best platform match for the given matching specs and platform.

Sorts the best platform match for the given matching specs and platform.

No documentation available
No documentation available
Instance Methods

Is other equal to this platform? Two platforms are equal if they have the same CPU, OS and version.

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 “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 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.

Does other match this platform? If other is a String it will be converted to a Gem::Platform first. See === for matching rules.

Deconstructs the platform into a hash for pattern matching. Returns a hash with keys :cpu, :os, and :version.

Gem::Platform.new("x86_64-darwin-20").deconstruct_keys(nil)
#=> { cpu: "x86_64", os: "darwin", version: "20" }

This enables hash pattern matching:

case Gem::Platform.new("x86_64-linux")
in cpu: "x86_64", os: "linux"
  # Matches Linux on x86_64
end
No documentation available
No documentation available
No documentation available