标签: ruby
如何重构此代码以仅使用一个Dir []调用?
Dir[ File.join('.', 'directory_a'), '*' ] + Dir[ File.join('.', 'directory_b'), '*' ] => [ contents of directory_a and directory_b ]
答案 0 :(得分:6)
Dir['./{directory_a,directory_b}/*']