From: Jonathan Castello Date: 2009-09-22T10:07:16+09:00 Subject: redirect STDOUT to function? --_b0992730-10b5-4b9c-87db-4854d1db1d23_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello=2C I'm using Ruby as a scripting language for a program that supports the WSH = scripting interface=2C and I have a small problem: 'puts' and other output = functions don't work (because STDOUT is invalid)=2C as with 'gets' (but wit= h STDIN). I'd like to redirect all accesses to STDOUT and STDIN to my own f= unctions=2C which would handle the IO through the main application's script= ing interface. I know that $stdout and others can be reassigned to other IO objects=2C but= I haven't yet found a way to reliably redirect through a function instead.= Of course=2C this is probably because I'm relatively new to Ruby. Does anyone know how I could do something like this?~Jonathan Castello _________________________________________________________________ Bing brings you health info from trusted sources. http://www.bing.com/search?q=3Dpet+allergy&form=3DMHEINA&publ=3DWLHMTAG&cre= a=3DTXT_MHEINA_Health_Health_PetAllergy_1x1= --_b0992730-10b5-4b9c-87db-4854d1db1d23_--