Method: Gem::ConflictError#initialize

Defined in:
lib/rubygems/errors.rb

#initialize(target, conflicts) ⇒ ConflictError

Returns a new instance of ConflictError.



81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/rubygems/errors.rb', line 81

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