Merge pull request #14979 from reitermarkus/env-config-generator

Fix `env_config` generator.
This commit is contained in:
Markus Reiter 2023-03-15 14:44:21 +01:00 committed by GitHub
commit ed831041b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -415,6 +415,7 @@ module Homebrew
},
}.freeze
sig { params(env: Symbol, hash: T::Hash[Symbol, T.untyped]).returns(String) }
def env_method_name(env, hash)
method_name = env.to_s
.sub(/^HOMEBREW_/, "")

View File

@ -13,7 +13,7 @@ File.open("#{__dir__}/../../env_config.rbi", "w") do |file|
dynamic_methods = {}
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)
dynamic_methods[name] = { default: hash[:default] }