From: "Mauricio Fernández" Date: 2003-03-02T02:47:30+09:00 Subject: Re: A question about require. On Sun, Mar 02, 2003 at 02:31:54AM +0900, Ben Thomas wrote: > Hello, > > I was wondering what is the best way to "re-require" a file in ruby. In > my code, I have a function that looks like this: > > def LoadAndExecute > require 'script_that_has_foo_in_it.rb' > foo > end > > If I executre that function once, then modify the script_that_...rb and > re-execute the LoadAndExecute function without stopping everything, the > script file isn't reaquired and foo re-execute the old code. I have > added the following line before require '...rb' > > $".delete "script_that_...rb" > > and it works fine but I want to make sure that it's a valid way of doing > "re-require". load "script_that_has_foo_in_it.rb" -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com Linux: Where Don't We Want To Go Today? -- Submitted by Pancrazio De Mauro, paraphrasing some well-known sales talk