Exception: FormulaConflictError Private
Overview
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
Raised when a formula conflicts with another one.
Instance Attribute Summary collapse
- #conflicts ⇒ Array<Formula::FormulaConflict> readonly private
- #formula ⇒ Formula readonly private
Instance Method Summary collapse
- #conflict_message(conflict) ⇒ String private
- #initialize(formula, conflicts) ⇒ void constructor private
- #message ⇒ String private
Constructor Details
#initialize(formula, conflicts) ⇒ void
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
547 548 549 550 551 |
# File 'exceptions.rb', line 547 def initialize(formula, conflicts) @formula = formula @conflicts = conflicts super end |
Instance Attribute Details
#conflicts ⇒ Array<Formula::FormulaConflict> (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
544 545 546 |
# File 'exceptions.rb', line 544 def conflicts @conflicts end |
#formula ⇒ Formula (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
541 542 543 |
# File 'exceptions.rb', line 541 def formula @formula end |
Instance Method Details
#conflict_message(conflict) ⇒ String
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
554 555 556 557 558 559 |
# File 'exceptions.rb', line 554 def (conflict) = [] << " #{conflict.name}" << ": because #{conflict.reason}" if conflict.reason .join end |
#message ⇒ String
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
562 563 564 565 566 567 568 569 570 571 572 573 574 575 |
# File 'exceptions.rb', line 562 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 |