Exception: TapUnavailableError 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 tap is unavailable.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ TapUnavailableError

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



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
# File 'exceptions.rb', line 291

def initialize(name)
  @name = name

  message = "No available tap #{name}.\n"
  if [CoreTap.instance.name, CoreCaskTap.instance.name].include?(name)
    command = "brew tap --force #{name}"
    message += <<~EOS
      Run #{Formatter.identifier(command)} to tap #{name}!
    EOS
  else
    command = "brew tap-new #{name}"
    message += <<~EOS
      Run #{Formatter.identifier(command)} to create a new #{name} tap!
    EOS
  end
  super message.freeze
end

Instance Attribute Details

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



289
290
291
# File 'exceptions.rb', line 289

def name
  @name
end