Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. 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.