Class: Bundler::Resolver::Candidate
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Instance Chain:
self,
Comparable
|
|
| Inherits: | Object |
| Defined in: | lib/bundler/resolver/candidate.rb |
Overview
This class is a PubGrub compatible "Version" class that takes ::Bundler
resolution complexities into account.
Each Candidate has a underlying Gem::Version plus a set of
platforms. For example, 1.1.0-x86_64-linux is a different resolution candidate
from 1.1.0 (generic). This is because different platform variants of the
same gem version can bring different dependencies, so they need to be
considered separately.
Some candidates may also keep some information explicitly about the package they refer to. These candidates are referred to as "canonical" and are used when materializing resolution results back into RubyGems specifications that can be installed, written to lockfiles, and so on.
Class Method Summary
Instance Attribute Summary
- #prerelease? ⇒ Boolean readonly
- #version readonly
- #priority readonly protected
Instance Method Summary
- #<=>(other)
- #==(other)
- #dependencies
- #eql?(other) ⇒ Boolean
- #hash
- #segments
-
#specs
The specifications selected together for this version and its platforms.
- #to_s
- #to_specs(package, most_specific_locked_platform)
Constructor Details
.new(version, group: nil, priority: -1)) ⇒ Candidate
Instance Attribute Details
#prerelease? ⇒ Boolean (readonly)
[ GitHub ]
# File 'lib/bundler/resolver/candidate.rb', line 48
def prerelease? @version.prerelease? end
#priority (readonly, protected)
[ GitHub ]# File 'lib/bundler/resolver/candidate.rb', line 87
attr_reader :priority
#version (readonly)
[ GitHub ]# File 'lib/bundler/resolver/candidate.rb', line 25
attr_reader :version
Instance Method Details
#<=>(other)
[ GitHub ]#==(other)
[ GitHub ]#dependencies
[ GitHub ]# File 'lib/bundler/resolver/candidate.rb', line 38
def dependencies @spec_group.dependencies end
#eql?(other) ⇒ Boolean
#hash
[ GitHub ]# File 'lib/bundler/resolver/candidate.rb', line 77
def hash [@version, @priority].hash end
#segments
[ GitHub ]# File 'lib/bundler/resolver/candidate.rb', line 52
def segments @version.segments end
#specs
The specifications selected together for this version and its platforms.
# File 'lib/bundler/resolver/candidate.rb', line 34
def specs @spec_group.specs end
#to_s
[ GitHub ]# File 'lib/bundler/resolver/candidate.rb', line 81
def to_s @version.to_s end
#to_specs(package, most_specific_locked_platform)
[ GitHub ]# File 'lib/bundler/resolver/candidate.rb', line 42
def to_specs(package, most_specific_locked_platform) return [] if package. @spec_group.to_specs(package.force_ruby_platform?, most_specific_locked_platform) end