End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Gem::Dependency#=~
=~(other)
lib/rubygems/dependency.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/rubygems/dependency.rb, line 189
def =~(other)
unless Gem::Dependency === other
return unless other.respond_to?(:name) && other.respond_to?(:version)
other = Gem::Dependency.new other.name, other.version
end
return false unless name === other.name
reqs = other.requirement.requirements
return false unless reqs.length == 1
return false unless reqs.first.first == '='
version = reqs.first.last
requirement.satisfied_by? version
end
Uses this dependency as a pattern to compare to other. This dependency will match if the name matches the other’s name, and other has only an equal version requirement that satisfies this dependency.