Comment BUILD_FLAGS.
This commit is contained in:
parent
08e35e9cb4
commit
e07b02fde2
@ -2378,12 +2378,13 @@ class Formula
|
||||
stable.build
|
||||
end
|
||||
|
||||
# Get the `BUILD_FLAGS` from the formula's namespace set in `Formulary::load_formula`.
|
||||
# @private
|
||||
def build_flags
|
||||
mod_name = to_s.split("::")[0..-2].join("::")
|
||||
return [] if mod_name.empty?
|
||||
namespace = to_s.split("::")[0..-2].join("::")
|
||||
return [] if namespace.empty?
|
||||
|
||||
mod = const_get(mod_name)
|
||||
mod = const_get(namespace)
|
||||
mod.const_get(:BUILD_FLAGS)
|
||||
end
|
||||
|
||||
|
||||
@ -34,6 +34,8 @@ module Formulary
|
||||
const_set(namespace, mod)
|
||||
|
||||
begin
|
||||
# Set `BUILD_FLAGS` in the formula's namespace so we can
|
||||
# access them from within the formula's class scope.
|
||||
mod.const_set(:BUILD_FLAGS, flags)
|
||||
mod.module_eval(contents, path)
|
||||
rescue NameError, ArgumentError, ScriptError => e
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user