Unrequiring a module

I

Iain Dooley

hello all, i'm using:

rb_require("file.rb");

to add a constant (class name) to my namespace in an embedded Ruby
application. If i want to change the implementation details of that
class without restart my application, how can i unrequire and re-require
that file?

thanks very much

Iain Dooley
 
A

Austin Ziegler

rb_require("file.rb");
=20
to add a constant (class name) to my namespace in an embedded Ruby
application. If i want to change the implementation details of that
class without restart my application, how can i unrequire and re-require
that file?

Strictly speaking, you can't. Well, you can't unrequire. However,
since all classes in Ruby are open, you can simply do the C-side
equivalent of Kernel.load.

-austin
--=20
Austin Ziegler * (e-mail address removed)
* Alternate: (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,176
Messages
2,570,950
Members
47,503
Latest member
supremedee

Latest Threads

Top