From: Ari Brown Date: 2007-07-25T04:39:12+09:00 Subject: Re: Attaching a script to IO On Jul 24, 2007, at 3:21 PM, Michael Gorsuch wrote: > Well, can you just send whatever you need to send via puts? > > Example: > > class MyThingy < GServer > def initialize(port=3000, *args) > super(port, *args) > end > def serve(io) > io.puts "Hello!" > end > end Well, except I'm not trying to send "hello". I'm trying to keep my script nice and clean, so I have a bunch of ugly code in a separate file (which I call with require) and a method test(). If I pass io as an argument with test: def serve(io) test(io) end and then later in test(io) have io.puts will the variable scope allow that? Or should I find a way to reroute $stdout? thanks, ari -------------------------------------------| Nietzsche is my copilot