instance method
Gem::Specification#activate_dependencies
activate_dependencies
lib/rubygems/specification.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems/specification.rb, line 1391
def activate_dependencies
unresolved = Gem::Specification.unresolved_deps
runtime_dependencies.each do |spec_dep|
if loaded = Gem.loaded_specs[spec_dep.name]
next if spec_dep.matches_spec? loaded
msg = "can't satisfy '#{spec_dep}', already activated '#{loaded.full_name}'"
e = Gem::LoadError.new msg
e.name = spec_dep.name
raise e
end
specs = spec_dep.matching_specs(true).uniq(&:full_name)
if specs.size == 0
raise Gem::MissingSpecError.new(spec_dep.name, spec_dep.requirement, "at: #{spec_file}")
elsif specs.size == 1
specs.first.activate
else
name = spec_dep.name
unresolved[name] = unresolved[name].merge spec_dep
end
end
unresolved.delete self.name
end
Activate all unambiguously resolved runtime dependencies of this spec. Add any ambiguous dependencies to the unresolved list to be resolved later, as needed.
See also
#activate
#add_bindir
#abbreviate
#add_dependency
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0