Exception: Migrator::MigratorDifferentTapsError Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Error for when a formula is migrated to a different tap without explicitly using its fully-qualified name.

Instance Method Summary collapse

Constructor Details

#initialize(formula, tap) ⇒ MigratorDifferentTapsError

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of MigratorDifferentTapsError.


39
40
41
42
43
44
45
46
47
48
49
50
# File 'Library/Homebrew/migrator.rb', line 39

def initialize(formula, tap)
  msg = if tap.core_tap?
    "Please try to use #{formula.oldname} to refer to the formula.\n"
  elsif tap
    "Please try to use fully-qualified #{tap}/#{formula.oldname} to refer to the formula.\n"
  end

  super <<~EOS
    #{formula.name} from #{formula.tap} is given, but old name #{formula.oldname} was installed from #{tap || "path or url"}.
    #{msg}To force migration use `brew migrate --force #{formula.oldname}`.
  EOS
end