Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Gem::Specification#add_dependency
add_dependency(gem, *requirements)
lib/rubygems/specification.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/rubygems/specification.rb, line 548
def add_dependency(gem, *requirements)
if requirements.uniq.size != requirements.size
warn "WARNING: duplicated #{gem} dependency #{requirements}"
end
add_dependency_with_type(gem, :runtime, requirements)
end
Adds a runtime dependency named gem with requirements to this gem.
Usage:
Example
spec.add_dependency 'example', '~> 1.1', '>= 1.1.4'
See also
#add_bindir
#add_dependency_with_type
#activate_dependencies
#add_development_dependency
also in
4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0