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 ⇒ Object readonly private
- #formula ⇒ Object readonly private
Instance Method Summary collapse
- #conflict_message(conflict) ⇒ Object private
-
#initialize(formula, conflicts) ⇒ FormulaConflictError
constructor
private
A new instance of FormulaConflictError.
- #message ⇒ String private
Constructor Details
#initialize(formula, conflicts) ⇒ FormulaConflictError
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.
Returns a new instance of FormulaConflictError.
410 411 412 413 414 |
# File 'exceptions.rb', line 410 def initialize(formula, conflicts) @formula = formula @conflicts = conflicts super end |
Instance Attribute Details
#conflicts ⇒ Object (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.
408 409 410 |
# File 'exceptions.rb', line 408 def conflicts @conflicts end |
#formula ⇒ Object (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.
408 409 410 |
# File 'exceptions.rb', line 408 def formula @formula end |
Instance Method Details
#conflict_message(conflict) ⇒ Object
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.
416 417 418 419 420 421 |
# File 'exceptions.rb', line 416 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.
424 425 426 427 428 429 430 431 432 433 434 435 436 437 |
# File 'exceptions.rb', line 424 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 |