mirror of
https://github.com/lloeki/ruby-tee.git
synced 2025-12-06 10:34:42 +01:00
making room for future tees (e.g fork_, thread_)
This commit is contained in:
parent
755bd3bc11
commit
31d6fa48c0
1 changed files with 2 additions and 1 deletions
3
tee.rb
3
tee.rb
|
|
@ -30,7 +30,7 @@ class IO
|
||||||
end
|
end
|
||||||
|
|
||||||
module Utils
|
module Utils
|
||||||
def tee(*procs)
|
def fiber_tee(*procs)
|
||||||
ios = procs.map { |proc| FiberChunkedIO.new &proc }
|
ios = procs.map { |proc| FiberChunkedIO.new &proc }
|
||||||
|
|
||||||
chunks.each do |chunk|
|
chunks.each do |chunk|
|
||||||
|
|
@ -41,6 +41,7 @@ class IO
|
||||||
ios.each { |io| io.close }
|
ios.each { |io| io.close }
|
||||||
ios.map { |io| io.result }
|
ios.map { |io| io.result }
|
||||||
end
|
end
|
||||||
|
alias_method :tee, :fiber_tee
|
||||||
end
|
end
|
||||||
|
|
||||||
include Chunkable
|
include Chunkable
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue