Exception: FormulaConflictError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- FormulaConflictError
- Defined in:
- 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 ⇒ String
Constructor Details
#initialize(formula, conflicts) ⇒ FormulaConflictError
Returns a new instance of FormulaConflictError.
411 412 413 414 415 |
# File 'exceptions.rb', line 411 def initialize(formula, conflicts) @formula = formula @conflicts = conflicts super end |
Instance Attribute Details
#conflicts ⇒ Object (readonly)
Returns the value of attribute conflicts.
409 410 411 |
# File 'exceptions.rb', line 409 def conflicts @conflicts end |
#formula ⇒ Object (readonly)
Returns the value of attribute formula.
409 410 411 |
# File 'exceptions.rb', line 409 def formula @formula end |
Instance Method Details
#conflict_message(conflict) ⇒ Object
417 418 419 420 421 422 |
# File 'exceptions.rb', line 417 def (conflict) = [] << " #{conflict.name}" << ": because #{conflict.reason}" if conflict.reason .join end |
#message ⇒ String
425 426 427 428 429 430 431 432 433 434 435 436 437 438 |
# File 'exceptions.rb', line 425 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 |