From: Andrew Wagner Date: 2010-08-05T23:02:41+09:00 Subject: Re: Abstracting exception handling --001485f91cbe73bb6c048d140094 Content-Type: text/plain; charset=UTF-8 What kind of stuff are you doing in my_script.rb? Defining a class? A method? Several methods? Just evaluating code? You might be able to use hook methods to wrap new code that gets defined, but you're being pretty vague right now. On Thu, Aug 5, 2010 at 9:51 AM, Martin Hansen wrote: > I was hoping for a setup like this in two files: > > my_script.rb: > > include "my_class" > > or raise > > __END__ > > > my_class.rb: > > def do_at_begin > set trap for signals. > status > end > > def do_at_exit > begin > rescue Exception > ensure > p status > end > end > > status = do_at_begin > > END { > do_at_exit(status) > } > > __END__ > > I want to keep the my_script.rb file minimal and hence move the error > handling to the included file. I have no idea if this can be done? > > > Martin > -- > Posted via http://www.ruby-forum.com/. > > --001485f91cbe73bb6c048d140094--