method
for

v2_6_3 -
Show latest stable
-
0 notes -
Class: SpecSet
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3 (0)
- What's this?
for(dependencies, skip = [], check = false, match_current_platform = false, raise_on_missing = true)
public
Hide source
# File lib/bundler/spec_set.rb, line 19 def for(dependencies, skip = [], check = false, match_current_platform = false, raise_on_missing = true) handled = Set.new deps = dependencies.dup specs = [] skip += ["bundler"] loop do break unless dep = deps.shift next if !handled.add?(dep) || skip.include?(dep.name) if spec = spec_for_dependency(dep, match_current_platform) specs << spec spec.dependencies.each do |d| next if d.type == :development d = DepProxy.new(d, dep.__platform) unless match_current_platform deps << d end elsif check return false elsif raise_on_missing others = lookup[dep.name] if match_current_platform message = "Unable to find a spec satisfying #{dep} in the set. Perhaps the lockfile is corrupted?" message += " Found #{others.join(", ")} that did not match the current platform." if others && !others.empty? raise GemNotFound, message end end if spec = lookup["bundler"].first specs << spec end check ? true : SpecSet.new(specs) end