Exception: TapFormulaWithOldnameAmbiguityError

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

Overview

Raised when a formula’s old name in a specific tap is found in multiple taps.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, possible_tap_newname_formulae) ⇒ TapFormulaWithOldnameAmbiguityError

Returns a new instance of TapFormulaWithOldnameAmbiguityError.



288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# File 'exceptions.rb', line 288

def initialize(name, possible_tap_newname_formulae)
  @name = name
  @possible_tap_newname_formulae = possible_tap_newname_formulae

  @taps = possible_tap_newname_formulae.map do |newname|
    newname =~ HOMEBREW_TAP_FORMULA_REGEX
    "#{Regexp.last_match(1)}/#{Regexp.last_match(2)}"
  end

  super <<~EOS
    Formulae with '#{name}' old name found in multiple taps: #{taps.map { |t| "\n       * #{t}" }.join}

    Please use the fully-qualified name (e.g. #{taps.first}/#{name}) to refer to the formula or use its new name.
  EOS
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



286
287
288
# File 'exceptions.rb', line 286

def name
  @name
end

#possible_tap_newname_formulaeObject (readonly)

Returns the value of attribute possible_tap_newname_formulae.



286
287
288
# File 'exceptions.rb', line 286

def possible_tap_newname_formulae
  @possible_tap_newname_formulae
end

#tapsObject (readonly)

Returns the value of attribute taps.



286
287
288
# File 'exceptions.rb', line 286

def taps
  @taps
end