[#106355] [Ruby master Bug#18373] RBS build failure: '/include/x86_64-linux/ruby/config.h', needed by 'constants.o'. — "vo.x (Vit Ondruch)" <noreply@...>
Issue #18373 has been reported by vo.x (Vit Ondruch).
28 messages
2021/12/01
[ruby-core:106437] [Ruby master Feature#18279] ENV.merge! support multile arguments as Hash.merge!
From:
"ko1 (Koichi Sasada)" <noreply@...>
Date:
2021-12-03 03:53:44 UTC
List:
ruby-core #106437
Issue #18279 has been updated by ko1 (Koichi Sasada).
Assignee set to matz (Yukihiro Matsumoto)
Status changed from Open to Assigned
`Hash#merge!(*other)` accepts multiple values, so I think it is acceptable.
Matz, how about it?
----------------------------------------
Feature #18279: ENV.merge! support multile arguments as Hash.merge!
https://bugs.ruby-lang.org/issues/18279#change-95080
* 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>