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) ⇒ 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
46 47 48 |
# File 'lib/bundler/resolver/spec_group.rb', line 46 def ==(other) sorted_spec_names == other.sorted_spec_names end |
#dependencies ⇒ Object
40 41 42 43 44 |
# File 'lib/bundler/resolver/spec_group.rb', line 40 def dependencies @dependencies ||= @specs.map do |spec| __dependencies(spec) + (spec) end.flatten.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
50 51 52 53 54 55 56 |
# File 'lib/bundler/resolver/spec_group.rb', line 50 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
36 37 38 |
# File 'lib/bundler/resolver/spec_group.rb', line 36 def to_s sorted_spec_names.join(", ") end |
#to_specs(force_ruby_platform) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/bundler/resolver/spec_group.rb', line 28 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 |
#version ⇒ Object
20 21 22 |
# File 'lib/bundler/resolver/spec_group.rb', line 20 def version @version ||= exemplary_spec.version end |