Class: Bundler::Resolver::SpecGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/bundler/resolver/spec_group.rb

Instance Method Summary collapse

Constructor Details

#initialize(specs) ⇒ SpecGroup

Returns a new instance of SpecGroup.



6
7
8
# File 'lib/bundler/resolver/spec_group.rb', line 6

def initialize(specs)
  @specs = specs
end

Instance Method Details

#dependenciesObject



39
40
41
42
43
# File 'lib/bundler/resolver/spec_group.rb', line 39

def dependencies
  @dependencies ||= @specs.map do |spec|
    __dependencies(spec) + (spec)
  end.flatten.uniq
end

#empty?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/bundler/resolver/spec_group.rb', line 10

def empty?
  @specs.empty?
end

#nameObject



14
15
16
# File 'lib/bundler/resolver/spec_group.rb', line 14

def name
  @name ||= exemplary_spec.name
end

#sourceObject



22
23
24
# File 'lib/bundler/resolver/spec_group.rb', line 22

def source
  @source ||= exemplary_spec.source
end

#to_sObject



35
36
37
# File 'lib/bundler/resolver/spec_group.rb', line 35

def to_s
  sorted_spec_names.join(", ")
end

#to_specs(force_ruby_platform) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/bundler/resolver/spec_group.rb', line 26

def to_specs(force_ruby_platform)
  @specs.map do |s|
    lazy_spec = LazySpecification.new(name, version, s.platform, source)
    lazy_spec.force_ruby_platform = force_ruby_platform
    lazy_spec.dependencies.replace s.dependencies
    lazy_spec
  end
end

#versionObject



18
19
20
# File 'lib/bundler/resolver/spec_group.rb', line 18

def version
  @version ||= exemplary_spec.version
end