From: Aaron Smith Date: 2007-07-05T23:40:25+09:00 Subject: Re: Destroy object from memory.. Object.const_destroy? Yukihiro Matsumoto wrote: > Hi, > > In message "Re: Destroy object from memory.. Object.const_destroy?" > on Thu, 5 Jul 2007 03:56:01 +0900, Aaron Smith > writes: > > |If I'm instantiating a instance of a class at using Object.const_get. > |How can I destroy it so that next time it reloads and code changes will > |take effect? > > I am not sure what you mean here. You don't instantiate anything > using const_get. You just get the reference to the existing object. > If you want to redefine class objects (without warning), you remove > the constant using remove_const(), and reload the program using > load(). But I'd recommend restarting the program, unless reloading is > absolutely necessary. > > matz. Thanks, That's pretty much what I was looking for. The problem I'm having is with a plugin in Rails. Once it runs, if code is executed, then changed at all, I have to restart Rails. Default rails controllers update just fine. They're probably using the remove_const(). But with my plugin I want to have the same functionality... Are there any major risks doing this? Wouldn't seem like it. Thanks -- Posted via http://www.ruby-forum.com/.