Exception: TapFormulaAmbiguityError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- TapFormulaAmbiguityError
- Defined in:
- exceptions.rb
Overview
Raised when a formula with the same name is found in multiple taps.
Instance Attribute Summary collapse
-
#formulae ⇒ Object
readonly
Returns the value of attribute formulae.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
Instance Method Summary collapse
-
#initialize(name, paths) ⇒ TapFormulaAmbiguityError
constructor
A new instance of TapFormulaAmbiguityError.
Constructor Details
#initialize(name, paths) ⇒ TapFormulaAmbiguityError
Returns a new instance of TapFormulaAmbiguityError.
266 267 268 269 270 271 272 273 274 275 276 277 278 |
# File 'exceptions.rb', line 266 def initialize(name, paths) @name = name @paths = paths @formulae = paths.map do |path| "#{Tap.from_path(path).name}/#{path.basename(".rb")}" end super <<~EOS Formulae found in multiple taps: #{formulae.map { |f| "\n * #{f}" }.join} Please use the fully-qualified name (e.g. #{formulae.first}) to refer to the formula. EOS end |
Instance Attribute Details
#formulae ⇒ Object (readonly)
Returns the value of attribute formulae.
264 265 266 |
# File 'exceptions.rb', line 264 def formulae @formulae end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
264 265 266 |
# File 'exceptions.rb', line 264 def name @name end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
264 265 266 |
# File 'exceptions.rb', line 264 def paths @paths end |