From: Nicholas Van Weerdenburg Date: 2005-01-19T13:31:35+09:00 Subject: Re: Webrick, erb, and .rhtml Is there an ERBOUT? How about doing: $stdout_default=$stdout # or STDOUT $stdout=ERBOUT This works for $stdout=$stderr, but I haven't tried it with erb. Nick On Wed, 19 Jan 2005 08:36:06 +0900, Charles Comstock wrote: > Martin DeMello wrote: > > Belorion wrote: > > > >>That's tough luck for me then. I have a significantly large rhtml > >>project that uses lots of puts and print because that works fine in > >>Apache/eRuby/mod_ruby. Guess I have a lot of busy work ahead of me, > >>changing all my puts/prints to <%= "" %> if I want to support Webrick > >>serving. Thanks for the help! > > > > > > Would simply overriding 'puts' and 'print' to return what they print > > work? That way you only need to change <% to <%= . > > > > martin > > Why is it that erb doesn't override kernel puts and print so they go to > ERBOUT instead of STDOUT. That way you wouldn't get weird orderings > when you use them and it would make more sense. If you actually want to > print output to stdout or anything like that then you explicitly call > STDOUT.print or .puts. I think alot of people assume that print and > puts output in the same interlaced order as the <% and <%= blocks, but > they really don't. Does anyone have a good reason why this should not > be the case? > Charles Comstock > > -- Nicholas Van Weerdenburg