[#109095] [Ruby master Misc#18888] Migrate ruby-lang.org mail services to Google Domains and Google Workspace — "shugo (Shugo Maeda)" <noreply@...>
Issue #18888 has been reported by shugo (Shugo Maeda).
16 messages
2022/06/30
[ruby-core:108955] [Ruby master Feature#18279] ENV.merge! support multiple arguments as Hash.merge!
From:
"matz (Yukihiro Matsumoto)" <noreply@...>
Date:
2022-06-16 08:52:09 UTC
List:
ruby-core #108955
Issue #18279 has been updated by matz (Yukihiro Matsumoto).
Accepted.
Matz.
----------------------------------------
Feature #18279: ENV.merge! support multiple arguments as Hash.merge!
https://bugs.ruby-lang.org/issues/18279#change-98051
* Author: zw963 (Wei Zheng)
* Status: Assigned
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
----------------------------------------
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))
```
--
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>