Class | DepSelector::Selector |
In: |
lib/dep_selector/selector.rb
|
Parent: | Object |
DEFAULT_ERROR_REPORTER | = | ErrorReporter::SimpleTreeTraverser.new |
dep_graph | [RW] | |
error_reporter | [RW] |
Based on solution_constraints, this method tries to find an assignment of PackageVersions that is compatible with the DependencyGraph. If one cannot be found, the constraints are added one at a time until the first unsatisfiable constraint is detected. Once the unsatisfiable solution constraint is identified, required non-existent packages and the most constrained packages are identified and thrown in a NoSolutionExists exception.
If a solution constraint refers to a package that doesn‘t exist or the constraint matches no versions, it is considered invalid. All invalid solution constraints are collected and raised in an InvalidSolutionConstraints exception. If valid_packages is non-nil, it is considered the authoritative list of extant Packages; otherwise, Package#valid? is used. This is useful if the dependency graph represents an already filtered set of packages such that a Package actually exists in your domain but is added to the dependency graph with no versions, in which case Package#valid? would return false even though we don‘t want to report that the package is non-existent.