blob: 371018ba44ee2e1e4e8172110e9962f359a93712 (
plain)
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
|
##
# Represents a possible Specification object returned
# from IndexSet. Used to delay needed to download full
# Specification objects when only the +name+ and +version+
# are needed.
class Gem::DependencyResolver::IndexSpecification
attr_reader :name
attr_reader :source
attr_reader :version
def initialize set, name, version, source, plat
@set = set
@name = name
@version = version
@source = source
@platform = plat
@spec = nil
end
def dependencies
spec.dependencies
end
def full_name
"#{@name}-#{@version}"
end
def inspect # :nodoc:
'#<%s %s source %s>' % [self.class, full_name, @source]
end
def pretty_print q # :nodoc:
q.group 2, '[Index specification', ']' do
q.breakable
q.text full_name
q.breakable
q.text ' source '
q.pp @source
end
end
def spec
@spec ||= @set.load_spec(@name, @version, @source)
end
end
|