Exception: Gem::Resolver::Molinillo::VersionConflict
- Inherits:
-
ResolverError
- Object
- StandardError
- ResolverError
- Gem::Resolver::Molinillo::VersionConflict
- Defined in:
- lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb
Overview
An error caused by conflicts in version
Instance Attribute Summary collapse
-
#conflicts ⇒ {String => Resolution::Conflict}
readonly
The conflicts that caused resolution to fail.
Instance Method Summary collapse
-
#initialize(conflicts) ⇒ VersionConflict
constructor
Initializes a new error with the given version conflicts.
Constructor Details
#initialize(conflicts) ⇒ VersionConflict
Initializes a new error with the given version conflicts.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb', line 60 def initialize(conflicts) pairs = [] conflicts.values.flatten.map(&:requirements).flatten.each do |conflicting| conflicting.each do |source, conflict_requirements| conflict_requirements.each do |c| pairs << [c, source] end end end super "Unable to satisfy the following requirements:\n\n" \ "#{pairs.map { |r, d| "- `#{r}` required by `#{d}`" }.join("\n")}" @conflicts = conflicts end |
Instance Attribute Details
#conflicts ⇒ {String => Resolution::Conflict} (readonly)
Returns the conflicts that caused resolution to fail.
56 57 58 |
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb', line 56 def conflicts @conflicts end |