Class: Bundler::Resolver::SpecGroup
- Inherits:
-
Object
- Object
- Bundler::Resolver::SpecGroup
- Defined in:
- lib/bundler/resolver/spec_group.rb
Instance Attribute Summary collapse
-
#specs ⇒ Object
readonly
Returns the value of attribute specs.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #dependencies ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(specs) ⇒ SpecGroup
constructor
A new instance of SpecGroup.
- #merge(other) ⇒ Object
- #name ⇒ Object
- #source ⇒ Object
- #to_s ⇒ Object
- #to_specs(force_ruby_platform, most_specific_locked_platform) ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(specs) ⇒ SpecGroup
Returns a new instance of SpecGroup.
8 9 10 |
# File 'lib/bundler/resolver/spec_group.rb', line 8 def initialize(specs) @specs = specs end |
Instance Attribute Details
#specs ⇒ Object (readonly)
Returns the value of attribute specs.
6 7 8 |
# File 'lib/bundler/resolver/spec_group.rb', line 6 def specs @specs end |
Instance Method Details
#==(other) ⇒ Object
47 48 49 |
# File 'lib/bundler/resolver/spec_group.rb', line 47 def ==(other) sorted_spec_names == other.sorted_spec_names end |
#dependencies ⇒ Object
41 42 43 44 45 |
# File 'lib/bundler/resolver/spec_group.rb', line 41 def dependencies @dependencies ||= @specs.flat_map do |spec| __dependencies(spec) + (spec) end.uniq.sort end |
#empty? ⇒ Boolean
12 13 14 |
# File 'lib/bundler/resolver/spec_group.rb', line 12 def empty? @specs.empty? end |
#merge(other) ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/bundler/resolver/spec_group.rb', line 51 def merge(other) return false unless equivalent?(other) @specs |= other.specs true end |
#name ⇒ Object
16 17 18 |
# File 'lib/bundler/resolver/spec_group.rb', line 16 def name @name ||= exemplary_spec.name end |
#source ⇒ Object
24 25 26 |
# File 'lib/bundler/resolver/spec_group.rb', line 24 def source @source ||= exemplary_spec.source end |
#to_s ⇒ Object
37 38 39 |
# File 'lib/bundler/resolver/spec_group.rb', line 37 def to_s sorted_spec_names.join(", ") end |
#to_specs(force_ruby_platform, most_specific_locked_platform) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/bundler/resolver/spec_group.rb', line 28 def to_specs(force_ruby_platform, most_specific_locked_platform) @specs.map do |s| lazy_spec = LazySpecification.from_spec(s) lazy_spec.force_ruby_platform = force_ruby_platform lazy_spec.most_specific_locked_platform = most_specific_locked_platform lazy_spec end end |
#version ⇒ Object
20 21 22 |
# File 'lib/bundler/resolver/spec_group.rb', line 20 def version @version ||= exemplary_spec.version end |