From: Eric Armstrong Date: 2006-04-11T08:47:33+09:00 Subject: Re: Rake: Making "cleanup" task Most excellent. How on earth did you find that? How did you know to look for it, orginally? Or did you just happen to stumble across it while persuing API docs using ri?? (In which case, that would seem to be the thing to do!) Logan Capaldo wrote: > > On Apr 7, 2006, at 9:10 PM, Eric Armstrong wrote: > >> That's looking like a cool solution. What is that >> at_exit thing, btw? Is that a standard part of rake >> I should know about? > > at_exit is a standard part of ruby > % ri at_exit > --------------------------------------------------------- Kernel#at_exit > at_exit { block } -> proc > ------------------------------------------------------------------------ > Converts block to a Proc object (and therefore binds it at the > point of call) and registers it for execution when the program > exits. If multiple handlers are registered, they are executed in > reverse order of registration. > > def do_at_exit(str1) > at_exit { print str1 } > end > at_exit { puts "cruel world" } > do_at_exit("goodbye ") > exit > > produces: > > goodbye cruel world > >