[ruby-core:105876] [Ruby master Feature#18279] ENV.merge! support multile arguments as hash.
From:
"zw963 (Wei Zheng)" <noreply@...>
Date:
2021-10-30 17:00:16 UTC
List:
ruby-core #105876
Issue #18279 has been reported by zw963 (Wei Zheng).
----------------------------------------
Feature #18279: ENV.merge! support multile arguments as hash.
https://bugs.ruby-lang.org/issues/18279
* Author: zw963 (Wei Zheng)
* Status: Open
* Priority: Normal
----------------------------------------
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)
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>