Fix env_config generator.

This commit is contained in:
Markus Reiter 2023-03-15 14:28:47 +01:00
parent 0d5e291fe1
commit 7591175f93
No known key found for this signature in database
GPG Key ID: 245293B51702655B
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] }