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) ⇒ 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.

Parameters:



376
377
378
379
380
381
382
383
384
385
386
387
388
389
# File 'exceptions.rb', line 376

def initialize(name, loaders)
  @name = name
  @loaders = loaders
  @taps = T.let(loaders.filter_map(&:tap), T::Array[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

#loadersArray<Formulary::FormulaLoader> (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.



373
374
375
# File 'exceptions.rb', line 373

def loaders
  @loaders
end

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

Returns:



367
368
369
# File 'exceptions.rb', line 367

def name
  @name
end

#tapsArray<Tap> (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.

Returns:



370
371
372
# File 'exceptions.rb', line 370

def taps
  @taps
end