Exception: TapFormulaAmbiguityError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, paths) ⇒ TapFormulaAmbiguityError

Returns a new instance of TapFormulaAmbiguityError



180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'Library/Homebrew/exceptions.rb', line 180

def initialize(name, paths)
  @name = name
  @paths = paths
  @formulae = paths.map do |path|
    match = path.to_s.match(HOMEBREW_TAP_PATH_REGEX)
    "#{Tap.fetch(match[:user], match[:repo])}/#{path.basename(".rb")}"
  end

  super <<~EOS
    Formulae found in multiple taps: #{formulae.map { |f| "\n       * #{f}" }.join}

    Please use the fully-qualified name e.g. #{formulae.first} to refer the formula.
  EOS
end

Instance Attribute Details

#formulaeObject (readonly)

Returns the value of attribute formulae



178
179
180
# File 'Library/Homebrew/exceptions.rb', line 178

def formulae
  @formulae
end

#nameObject (readonly)

Returns the value of attribute name



178
179
180
# File 'Library/Homebrew/exceptions.rb', line 178

def name
  @name
end

#pathsObject (readonly)

Returns the value of attribute paths



178
179
180
# File 'Library/Homebrew/exceptions.rb', line 178

def paths
  @paths
end