From: Xandy Johnson Date: 2002-11-05T22:04:29+09:00 Subject: Re: Newbie Problem with Shell#transact OK. That works, but the more important question is, "Why?" Is there a general principle I can apply here? Should it be considered a bug? At least for me, it violates the Principle Of Least Surprise, but my Ruby intuition is not yet well trained. Thanks, Xandy On Tue, 2002-11-05 at 04:54, ts wrote: > >>>>> "X" == Xandy Johnson writes: > > Write it like this > > > X> class JarGrepper > X> attr_writer :pattern > X> def jartoc(jarfile) > X> sh = Shell.new > > pattern = @pattern > > X> sh.transact do > X> results = jar("tf", jarfile) | grepcmd(@pattern) > > results = jar("tf", jarfile) | grepcmd(pattern) > > X> puts results > X> end > X> end > X> end > > > > Guy Decoux