Class: Bundler::Materialization
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/bundler/materialization.rb |
Overview
This class materializes a set of resolved specifications (LazySpecification
) for a given gem into the most appropriate real specifications (StubSepecification
, EndpointSpecification
, etc), given a dependency and a target platform.
Class Method Summary
Instance Attribute Summary
- #complete? ⇒ Boolean readonly
- #dep readonly private
- #platform readonly private
Instance Method Summary
Constructor Details
.new(dep, platform, candidates:) ⇒ Materialization
Instance Attribute Details
#complete? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/bundler/materialization.rb', line 17
def complete? specs.any? end
#dep (readonly, private)
[ GitHub ]# File 'lib/bundler/materialization.rb', line 57
attr_reader :dep, :platform
#platform (readonly, private)
[ GitHub ]# File 'lib/bundler/materialization.rb', line 57
attr_reader :dep, :platform
Instance Method Details
#completely_missing_specs
[ GitHub ]#dependencies
[ GitHub ]#incomplete_specs
[ GitHub ]# File 'lib/bundler/materialization.rb', line 49
def incomplete_specs return [] if complete? @candidates || LazySpecification.new(dep.name, nil, nil) end
#materialized_spec
[ GitHub ]# File 'lib/bundler/materialization.rb', line 35
def materialized_spec specs.reject(&:missing?).first&.materialization end
#partially_missing_specs
[ GitHub ]# File 'lib/bundler/materialization.rb', line 45
def partially_missing_specs specs.select(&:missing?) end
#specs
[ GitHub ]# File 'lib/bundler/materialization.rb', line 21
def specs @specs ||= if @candidates.nil? [] elsif platform GemHelpers.select_best_platform_match(@candidates, platform, force_ruby: dep.force_ruby_platform) else GemHelpers.select_best_local_platform_match(@candidates, force_ruby: dep.force_ruby_platform || dep.default_force_ruby_platform) end end