lib/polyphony/extensions/io.rb in polyphony-0.82 vs lib/polyphony/extensions/io.rb in polyphony-0.83

- old
+ new

@@ -71,10 +71,18 @@ def popen(cmd, mode = 'r') return orig_popen(cmd, mode) unless block_given? Open3.popen2(cmd) { |_i, o, _t| yield o } end + + def splice(src, dest, maxlen) + Polyphony.backend_splice(src, dest, maxlen) + end + + def splice_to_eof(src, dest, chunk_size = 8192) + Polyphony.backend_splice_to_eof(src, dest, chunk_size) + end end end # IO instance method patches class ::IO @@ -255,13 +263,13 @@ Polyphony.backend_wait_io(self, true) self end end - def splice(src, maxlen) + def splice_from(src, maxlen) Polyphony.backend_splice(src, self, maxlen) end - def splice_to_eof(src, chunksize = 8192) + def splice_to_eof_from(src, chunksize = 8192) Polyphony.backend_splice_to_eof(src, self, chunksize) end end