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



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

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



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

def to_s
  sorted_spec_names.join(", ")
end

#to_specs(force_ruby_platform) ⇒ Object



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

def to_specs(force_ruby_platform)
  @specs.map do |s|
    lazy_spec = LazySpecification.from_spec(s)
    lazy_spec.force_ruby_platform = force_ruby_platform
    lazy_spec
  end
end

#versionObject



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

def version
  @version ||= exemplary_spec.version
end