summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mrblib/io.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/mrblib/io.rb b/mrblib/io.rb
index ca687aee0..63a1bb714 100644
--- a/mrblib/io.rb
+++ b/mrblib/io.rb
@@ -41,6 +41,11 @@ class IO
end
end
+ def flush
+ # mruby-io always writes immediately (no output buffer).
+ self
+ end
+
def write(string)
str = string.is_a?(String) ? string : string.to_s
return str.size unless str.size > 0