Exception: Migrator::MigratorDifferentTapsError Private

Inherits:
RuntimeError
  • Object
show all
Defined in:
migrator.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.

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



42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'migrator.rb', line 42

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, run:
      brew migrate --force #{formula.oldname}
  EOS
end