Ruby 4.1 リファレンスマニュアル

singleton method Gem::Platform.match_spec?

match_spec?(spec) -> boolRuby 3.0 から[permalink][rdoc][edit]

spec のプラットフォームが現在の環境にインストール可能かどうかを返します。

Gem::Platform.match_gem? に、spec の Gem::Specification#platform と Gem::Specification#name を渡した結果を返します。

[PARAM] spec:
判定したい Gem::Specification のインスタンスを指定します。
例
spec = Gem::Specification.new("rake", "1.0.0")
spec.platform = Gem::Platform::RUBY
p Gem::Platform.match_spec?(spec) # => true

[SEE_ALSO] Gem::Platform.match_gem?