Unloading (or unrequiring) a file

Hey all,

I’m trying to dynamically load parts of code to make things and
methods available.

The catch is that I’d also like to make those things and methods
UNavailable as well (or load something else in place of the original
loaded item).

I know there’s no Kernel#unload, so how can I achieve my goal?

Nietzsche is my copilot

On 8/17/07, Ari B. [email protected] wrote:

As far as methods go there’s remove_method and undef_method. For
constants theres remove_const. An idea I’ve had was to fork, although
that’s a little heavy handed


… code …
pid = fork do
require ‘this_will_go_away’
but_so_will_this_var = ThisWillGoAway.new

Process.wait pid

p but_so_will_this_var # NameError