Merge pull request #5876 from dearblue/dir-foreach

Close the directory object with the `Dir.foreach` method
This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-12-26 13:27:53 +09:00
committed by GitHub
+3 -1
View File
@@ -25,7 +25,9 @@ class Dir
alias children entries
def foreach(path, &block)
self.open(path).each(&block)
self.open(path) do |d|
d.each(&block)
end
end
def open(path, &block)