instance method
Gem::DependencyList#ok_to_remove?
ok_to_remove?(full_name, check_dev = true)
lib/rubygems/dependency_list.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems/dependency_list.rb, line 142
def ok_to_remove?(full_name, check_dev = true)
gem_to_remove = find_name full_name
# If the state is inconsistent, at least don't crash
return true unless gem_to_remove
siblings = @specs.find_all do |s|
s.name == gem_to_remove.name &&
s.full_name != gem_to_remove.full_name
end
deps = []
@specs.each do |spec|
check = check_dev ? spec.dependencies : spec.runtime_dependencies
check.each do |dep|
deps << dep if gem_to_remove.satisfies_requirement?(dep)
end
end
deps.all? do |dep|
siblings.any? do |s|
s.satisfies_requirement? dep
end
end
end
It is ok to remove a gemspec from the dependency list?
If removing the gemspec creates breaks a currently ok dependency, then it is NOT ok to remove the gemspec.
See also
#ok?
#remove_by_name
#find_name
#remove_specs_unsatisfied_by
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0