Exception: FormulaConflictError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- FormulaConflictError
- Defined in:
- Library/Homebrew/exceptions.rb
Overview
Raised when a formula conflicts with another one.
Instance Attribute Summary collapse
-
#conflicts ⇒ Object
readonly
Returns the value of attribute conflicts.
-
#formula ⇒ Object
readonly
Returns the value of attribute formula.
Instance Method Summary collapse
- #conflict_message(conflict) ⇒ Object
-
#initialize(formula, conflicts) ⇒ FormulaConflictError
constructor
A new instance of FormulaConflictError.
- #message ⇒ Object
Constructor Details
#initialize(formula, conflicts) ⇒ FormulaConflictError
Returns a new instance of FormulaConflictError.
332 333 334 335 336 |
# File 'Library/Homebrew/exceptions.rb', line 332 def initialize(formula, conflicts) @formula = formula @conflicts = conflicts super end |
Instance Attribute Details
#conflicts ⇒ Object (readonly)
Returns the value of attribute conflicts
330 331 332 |
# File 'Library/Homebrew/exceptions.rb', line 330 def conflicts @conflicts end |
#formula ⇒ Object (readonly)
Returns the value of attribute formula
330 331 332 |
# File 'Library/Homebrew/exceptions.rb', line 330 def formula @formula end |
Instance Method Details
#conflict_message(conflict) ⇒ Object
338 339 340 341 342 343 |
# File 'Library/Homebrew/exceptions.rb', line 338 def (conflict) = [] << " #{conflict.name}" << ": because #{conflict.reason}" if conflict.reason .join end |
#message ⇒ Object
345 346 347 348 349 350 351 352 353 354 355 356 357 358 |
# File 'Library/Homebrew/exceptions.rb', line 345 def = [] << "Cannot install #{formula.full_name} because conflicting formulae are installed." .concat conflicts.map { |c| (c) } << "" << <<~EOS Please `brew unlink #{conflicts.map(&:name) * " "}` before continuing. Unlinking removes a formula's symlinks from #{HOMEBREW_PREFIX}. You can link the formula again after the install finishes. You can --force this install, but the build may fail or cause obscure side effects in the resulting software. EOS .join("\n") end |