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#merge
merge(other)
lib/rubygems/dependency.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/rubygems/dependency.rb, line 258
def merge(other)
unless name == other.name
raise ArgumentError,
"#{self} and #{other} have different names"
end
default = Gem::Requirement.default
self_req = self.requirement
other_req = other.requirement
return self.class.new name, self_req if other_req == default
return self.class.new name, other_req if self_req == default
self.class.new name, self_req.as_list.concat(other_req.as_list)
end
Merges the requirements of other into this dependency
See also
#matching_specs
#prerelease?
#matches_spec?
#requirement
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1