Project

General

Profile

Feature #18279

Updated by zw963 (Wei Zheng) 7 months ago

I give a useful example for this. 

 ```rb 
 require 'yaml' 
 env_files = ['config.yml', 'config.local'] 
 envs = env_files.filter_map {|file| YAML.load_file(file)['env'] if File.file?(file) } 
 ENV.merge!(*envs) # Raise wrong number of arguments (given 2, expected 1) 


 ``` 

 For now, above code have do like this in ruby 3.0.2 

 ```rb 
 ENV.merge!({}.merge!(*envs)) 
 ```

Back