-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path!!!!
64 lines (54 loc) · 1.77 KB
/
!!!!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
module Pod
class Specification
class Set
class LazySpecification < BasicObject
attr_reader :name, :version, :source
def initialize(name, version, source)
@name = name
@version = version
@source = source
end
def method_missing(method, *args, &block)
specification.send(method, *args, &block)
end
def respond_to_missing?(method, include_all = false)
specification.respond_to?(method, include_all)
end
def subspec_by_name(name = nil, raise_if_missing = true)
if !name || name == self.name
self
else
specification.subspec_by_name(name, raise_if_missing)
end
end
def specification
@specification ||= source.specification(name, version.version)
end
end
class External
def all_specifications
[specification]
end
end
def all_specifications
@all_specifications ||= begin
sources_by_version = {}
versions_by_source.each do |source, versions|
versions.each { |v| (sources_by_version[v] ||= []) << source }
sources_by_version
end
duplicate_versions = sources_by_version.select { |_version, sources| sources.count > 1 }
duplicate_versions.each do |version, sources|
UI.warn "Found multiple specifications for `#{name} (#{version})`:\n" +
sources.
map { |s| s.specification_path(name, version) }.
map { |v| "- #{v}" }.join("\n")
end
versions_by_source.flat_map do |source, versions|
versions.map { |version| LazySpecification.new(name, version, source) }
end
end
end
end
end
end