Exception: TapFormulaAmbiguityError

Inherits:
RuntimeError
  • Object
show all
Defined in:
Library/Homebrew/exceptions.rb

Overview

Raised when a formula with the same name is found multiple taps.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, paths) ⇒ TapFormulaAmbiguityError

Returns a new instance of TapFormulaAmbiguityError.


201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'Library/Homebrew/exceptions.rb', line 201

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

#formulaeObject (readonly)

Returns the value of attribute formulae


199
200
201
# File 'Library/Homebrew/exceptions.rb', line 199

def formulae
  @formulae
end

#nameObject (readonly)

Returns the value of attribute name


199
200
201
# File 'Library/Homebrew/exceptions.rb', line 199

def name
  @name
end

#pathsObject (readonly)

Returns the value of attribute paths


199
200
201
# File 'Library/Homebrew/exceptions.rb', line 199

def paths
  @paths
end