Merge pull request #14979 from reitermarkus/env-config-generator
Fix `env_config` generator.
This commit is contained in:
commit
ed831041b9
@ -415,6 +415,7 @@ module Homebrew
|
|||||||
},
|
},
|
||||||
}.freeze
|
}.freeze
|
||||||
|
|
||||||
|
sig { params(env: Symbol, hash: T::Hash[Symbol, T.untyped]).returns(String) }
|
||||||
def env_method_name(env, hash)
|
def env_method_name(env, hash)
|
||||||
method_name = env.to_s
|
method_name = env.to_s
|
||||||
.sub(/^HOMEBREW_/, "")
|
.sub(/^HOMEBREW_/, "")
|
||||||
|
@ -13,7 +13,7 @@ File.open("#{__dir__}/../../env_config.rbi", "w") do |file|
|
|||||||
|
|
||||||
dynamic_methods = {}
|
dynamic_methods = {}
|
||||||
Homebrew::EnvConfig::ENVS.each do |env, hash|
|
Homebrew::EnvConfig::ENVS.each do |env, hash|
|
||||||
next if Homebrew::EnvConfig::CUSTOM_IMPLEMENTATIONS.include?(env.to_s)
|
next if Homebrew::EnvConfig::CUSTOM_IMPLEMENTATIONS.include?(env)
|
||||||
|
|
||||||
name = Homebrew::EnvConfig.env_method_name(env, hash)
|
name = Homebrew::EnvConfig.env_method_name(env, hash)
|
||||||
dynamic_methods[name] = { default: hash[:default] }
|
dynamic_methods[name] = { default: hash[:default] }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user