From: Thomas Sondergaard Date: 2003-09-22T10:28:14+09:00 Subject: Re: Making my own output stream > This is probably a dumb question, but: > if I want to make a class such that an instance of it > can be assigned to $stdout without breaking anything, > what does it need to implement? Can I just define a #write > method and include some mixin to handle the rest? Unfortunately not. Implementing a new IO is not as trivial as it should be. For rubyzip I have implemented an AbstractOutputStream module that implements all the "output" methods of IO class TestOutputStream include AbstractOutputStream attr_accessor :buffer def initialize @buffer = "" end def << (data) @buffer << data self end end You could try it and see if it works. Cheers, Thomas