Exception: Bundler::Molinillo::VersionConflict

Inherits:
ResolverError
  • Object
show all
Defined in:
lib/bundler/vendor/molinillo/lib/molinillo/errors.rb

Overview

An error caused by conflicts in version

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(conflicts) ⇒ VersionConflict

Returns a new instance of VersionConflict.

Parameters:

  • conflicts ({String => Resolution::Conflict})


54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/bundler/vendor/molinillo/lib/molinillo/errors.rb', line 54

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.

Returns:

  • ({String => Resolution::Conflict})

    the conflicts that caused resolution to fail



51
52
53
# File 'lib/bundler/vendor/molinillo/lib/molinillo/errors.rb', line 51

def conflicts
  @conflicts
end