Exception: Gem::ConflictError

Inherits:
LoadError
  • Object
show all
Defined in:
lib/rubygems/errors.rb

Overview

Raised when there are conflicting gem specs loaded

Instance Attribute Summary collapse

Attributes inherited from LoadError

#name, #requirement

Instance Method Summary collapse

Constructor Details

#initialize(target, conflicts) ⇒ ConflictError

Returns a new instance of ConflictError.


90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/rubygems/errors.rb', line 90

def initialize(target, conflicts)
  @target    = target
  @conflicts = conflicts
  @name      = target.name

  reason = conflicts.map do |act, dependencies|
    "#{act.full_name} conflicts with #{dependencies.join(", ")}"
  end.join ", "

  # TODO: improve message by saying who activated `con`

  super("Unable to activate #{target.full_name}, because #{reason}")
end

Instance Attribute Details

#conflictsObject (readonly)

A Hash mapping conflicting specifications to the dependencies that caused the conflict


83
84
85
# File 'lib/rubygems/errors.rb', line 83

def conflicts
  @conflicts
end

#targetObject (readonly)

The specification that had the conflict


88
89
90
# File 'lib/rubygems/errors.rb', line 88

def target
  @target
end