mruby-dir/dir.rb: rename `each` to `each_child`
MODIFY
mrbgems/mruby-dir/mrblib/dir.rb
mrbgems/mruby-dir/mrblib/dir.rb
class Dir
- def each(&block)
+ def each_child(&block)
while s = self.read
block.call(s)
end
@@ -21,7 +21,7 @@ class Dir
end
def foreach(path, &block)
- self.open(path).each(&block)
+ self.open(path).each_child(&block)
end
def open(path, &block)

MODIFY
mrbgems/mruby-dir/test/dir.rb
mrbgems/mruby-dir/test/dir.rb
@@ -52,7 +52,7 @@ end
assert('Dir.open') do
a = []
Dir.open(DirTest.sandbox) { |d|
- d.each { |s| a << s }
+ d.each_child { |s| a << s }
}
assert_true a.include?("a")
assert_true a.include?("b")
@@ -69,10 +69,10 @@ assert('Dir#close') do
assert_nothing_raised{d.close}
end
-assert('Dir#each') do
+assert('Dir#each_child') do
a = []
d = Dir.open(DirTest.sandbox)
- d.each { |s| a << s }
+ d.each_child { |s| a << s }
d.close
assert_true a.include?("a")
assert_true a.include?("b")

mruby-dir/dir.rb: rename `each` to `each_child`