diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-06-06 20:26:37 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-06-06 20:26:37 +0000 |
commit | 1db6afb8369cafdfe05680798ee68fe3081251d2 (patch) | |
tree | 802ac2762d0e0af1c9be43aca60d81ad2acbfa1b | |
parent | a2026eae297ee6b911b77d07e1d96a0136e1a114 (diff) | |
download | ruby_io_splice-1db6afb8369cafdfe05680798ee68fe3081251d2.tar.gz |
-rw-r--r-- | lib/io/splice.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/io/splice.rb b/lib/io/splice.rb index 38307c6..227d63c 100644 --- a/lib/io/splice.rb +++ b/lib/io/splice.rb @@ -33,7 +33,7 @@ class IO # If len is specified, then only len bytes are copied. Otherwise # the copy will be until EOF is reached on the +src+. # +src+ and +dst+ must be IO objects or respond to +to_io+ - def self.copy_stream(src, dst, len = nil, src_offset = nil) + def Splice.copy_stream(src, dst, len = nil, src_offset = nil) close = [] src.kind_of?(String) and close << (src = File.open(src, 'rb')) dst.kind_of?(String) and close << (dst = File.open(dst, 'wb')) @@ -85,7 +85,7 @@ class IO # The +_select_args+ parameter is reserved for internal use and # may be removed in future versions. Do not write code that # depends on +_select_args+. - def self.full(src, dst, len, _select_args = selectable(src, dst)) + def Splice.full(src, dst, len, _select_args = selectable(src, dst)) nr = len nr -= partial(src, dst, nr, _select_args) until nr == 0 len @@ -99,7 +99,7 @@ class IO # The +_select_args+ parameter is reserved for internal use and # may be removed in future versions. Do not write code that # depends on +_select_args+. - def self.partial(src, dst, len, _select_args = selectable(src, dst)) + def Splice.partial(src, dst, len, _select_args = selectable(src, dst)) begin IO.splice(src, nil, dst, nil, len, F_MOVE) rescue Errno::EAGAIN @@ -109,7 +109,7 @@ class IO end # returns an array suitable for splat-ing to IO.select for blocking I/O - def self.selectable(src, dst) + def Splice.selectable(src, dst) rv = [] src.stat.pipe? or rv[0] = [ src ] dst.stat.pipe? or rv[1] = [ dst ] |