Class: Bundler::Resolver::SpecGroup
- Inherits:
-
Object
- Object
- Bundler::Resolver::SpecGroup
- Defined in:
- lib/bundler/resolver/spec_group.rb
Instance Method Summary collapse
- #dependencies ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(specs) ⇒ SpecGroup
constructor
A new instance of SpecGroup.
- #name ⇒ Object
- #source ⇒ Object
- #to_s ⇒ Object
- #to_specs(force_ruby_platform) ⇒ Object
- #version ⇒ Object
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
#dependencies ⇒ Object
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
10 11 12 |
# File 'lib/bundler/resolver/spec_group.rb', line 10 def empty? @specs.empty? end |
#name ⇒ Object
14 15 16 |
# File 'lib/bundler/resolver/spec_group.rb', line 14 def name @name ||= exemplary_spec.name end |
#source ⇒ Object
22 23 24 |
# File 'lib/bundler/resolver/spec_group.rb', line 22 def source @source ||= exemplary_spec.source end |
#to_s ⇒ Object
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 |
#version ⇒ Object
18 19 20 |
# File 'lib/bundler/resolver/spec_group.rb', line 18 def version @version ||= exemplary_spec.version end |