Cleanup code and remove unneeded methods
This commit is contained in:
parent
50fac1737a
commit
e8e1deeb32
@ -77,10 +77,6 @@ class Formula
|
||||
# e.g. `this-formula`
|
||||
attr_reader :name
|
||||
|
||||
# The path to the alias that was used to identify this {Formula}.
|
||||
# e.g. `/usr/local/Library/Taps/homebrew/homebrew-core/Aliases/another-name-for-this-formula`
|
||||
attr_reader :bottle_path
|
||||
|
||||
# The path to the alias that was used to identify this {Formula}.
|
||||
# e.g. `/usr/local/Library/Taps/homebrew/homebrew-core/Aliases/another-name-for-this-formula`
|
||||
attr_reader :alias_path
|
||||
@ -312,18 +308,12 @@ class Formula
|
||||
full_name_with_optional_tap(installed_alias_name)
|
||||
end
|
||||
|
||||
def prefix_formula_file
|
||||
return unless prefix.directory?
|
||||
|
||||
prefix/".brew/#{name}.rb"
|
||||
end
|
||||
|
||||
# The path that was specified to find this formula.
|
||||
def specified_path
|
||||
default_specified_path = alias_path || path
|
||||
|
||||
return default_specified_path if default_specified_path.present? && default_specified_path.exist?
|
||||
return local_bottle_path if local_bottle_path.present? && local_bottle_path.exist?
|
||||
return default_specified_path if default_specified_path.presence&.exist?
|
||||
return local_bottle_path if local_bottle_path.presence&.exist?
|
||||
|
||||
default_specified_path
|
||||
end
|
||||
|
||||
@ -287,7 +287,7 @@ module FormulaCellarChecks
|
||||
def check_cpuid_instruction(formula)
|
||||
return unless formula.prefix.directory?
|
||||
# TODO: add methods to `utils/ast` to allow checking for method use
|
||||
return unless formula.prefix_formula_file.read.include? "ENV.runtime_cpu_detection"
|
||||
return unless (formula.prefix/".brew/#{formula.name}.rb").read.include? "ENV.runtime_cpu_detection"
|
||||
# Checking for `cpuid` only makes sense on Intel:
|
||||
# https://en.wikipedia.org/wiki/CPUID
|
||||
return unless Hardware::CPU.intel?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user