diff options
| author | Tomoyuki Sahara <[email protected]> | 2014-02-12 16:33:34 +0900 |
|---|---|---|
| committer | Tomoyuki Sahara <[email protected]> | 2014-02-12 16:33:34 +0900 |
| commit | daa65c15dea5157a67876bd4b450971bd4832862 (patch) | |
| tree | d2b595ce92170f1bda39ad51075917d601bfd8e1 | |
| parent | 40c52f58d02e4991cb5aa36d14f4e724d810315e (diff) | |
| download | mruby-daa65c15dea5157a67876bd4b450971bd4832862.tar.gz mruby-daa65c15dea5157a67876bd4b450971bd4832862.zip | |
add dummy IO#flush for better compatibility with CRuby.
| -rw-r--r-- | mrblib/io.rb | 5 |
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 |
