Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Gem::Dependency#match?

dep.match? name => true or false
dep.match? name, version => true or false
dep.match? spec => true or false

Does this dependency match the specification described by name and version or match spec?

NOTE: Unlike matches_spec? this method does not return true when the version is a prerelease version unless this is a prerelease dependency.