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