public
Description: A process execution library which doesn't suck.
Clone URL: git://github.com/codahale/ropen.git
codahale (author)
Thu May 15 14:27:52 -0700 2008
commit  04fc99c893e0666254071fbee53be27206aa8652
tree    1501aeac87ad288620772e0c7546fb4fa86b5a19
parent  b18d73130f5f0562b5085cab15fd17c262964868
ropen / lib / ropen / spool.rb
100644 20 lines (16 sloc) 0.325 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require "ropen"
 
# TODO: document me
 
class Ropen::Spool
  def initialize
    @messages = []
  end
  
  def method_missing(m, *args, &block)
    @messages << [m, args, block]
  end
  
  def replay(stream)
    while message = @messages.shift
      m, args, block = message
      stream.send(m, *args, &block)
    end
  end
end