Exception: TapFormulaAmbiguityError Private

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

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 with the same name is found in multiple taps.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, loaders) ⇒ TapFormulaAmbiguityError

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 TapFormulaAmbiguityError.



271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'exceptions.rb', line 271

def initialize(name, loaders)
  @name = name
  @loaders = loaders
  @taps = loaders.map(&:tap)

  formulae = taps.map { |tap| "#{tap}/#{name}" }
  formula_list = formulae.map { |f| "\n       * #{f}" }.join

  super <<~EOS
    Formulae found in multiple taps:#{formula_list}

    Please use the fully-qualified name (e.g. #{formulae.first}) to refer to a specific formula.
  EOS
end

Instance Attribute Details

#loadersObject (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.



269
270
271
# File 'exceptions.rb', line 269

def loaders
  @loaders
end

#nameObject (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.



269
270
271
# File 'exceptions.rb', line 269

def name
  @name
end

#tapsObject (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.



269
270
271
# File 'exceptions.rb', line 269

def taps
  @taps
end