Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Gem::Dependency#=~
=~(other)
lib/rubygems/dependency.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/rubygems/dependency.rb, line 188
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.