summaryrefslogtreecommitdiffhomepage
path: root/mrblib/io.rb
diff options
context:
space:
mode:
Diffstat (limited to 'mrblib/io.rb')
-rw-r--r--mrblib/io.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/mrblib/io.rb b/mrblib/io.rb
index c838b96e5..4d2fda5f3 100644
--- a/mrblib/io.rb
+++ b/mrblib/io.rb
@@ -108,6 +108,11 @@ class IO
raise IOError
end
+ def <<(str)
+ write(str)
+ self
+ end
+
def eof?
return true if @buf && @buf.size > 0
@@ -136,6 +141,10 @@ class IO
seek(i, SEEK_SET)
end
+ def rewind
+ seek(0, SEEK_SET)
+ end
+
def seek(i, whence = SEEK_SET)
raise IOError if closed?
@pos = sysseek(i, whence)