diff options
| -rw-r--r-- | mrbgems/mruby-io/mrblib/io.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mrbgems/mruby-io/mrblib/io.rb b/mrbgems/mruby-io/mrblib/io.rb index 8297cb1b5..5c06dc5d8 100644 --- a/mrbgems/mruby-io/mrblib/io.rb +++ b/mrbgems/mruby-io/mrblib/io.rb @@ -303,6 +303,8 @@ class IO # 15.2.20.5.3 def each(&block) + return to_enum unless block + while line = self.gets block.call(line) end @@ -311,6 +313,8 @@ class IO # 15.2.20.5.4 def each_byte(&block) + return to_enum(:each_byte) unless block + while char = self.getc block.call(char) end |
