Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
reloading required modules in irb
Heikki Kupiainen
8/6/2006 1:03:00 PM
Hi,
I use irb to evaluate my code while programming.
So it is easy to test my class this way:
> require "my_class"
> c = MyClass.new
> c.some_method
But the problem occurs when I now edit the class adding a new method
"new_method". If I then type:
> c.new_method
NoMethodError: undefined method :'new_method'
How can i now re-require "my_class" without restarting irb?
typing again the require command doesn't seem to reload MyClass:
> require "my_class"
Nothing happens! The class is not reloaded into memory.
Please tell me somebody how I can refresh the required class!
--
Posted via
http://www.ruby-...
.
2 Answers
Logan Capaldo
8/6/2006 1:15:00 PM
0
On Aug 6, 2006, at 9:03 AM, Heikki Kupiainen wrote:
> Hi,
>
> I use irb to evaluate my code while programming.
> So it is easy to test my class this way:
>
>> require "my_class"
>> c = MyClass.new
>> c.some_method
>
> But the problem occurs when I now edit the class adding a new method
> "new_method". If I then type:
>
>> c.new_method
> NoMethodError: undefined method :'new_method'
>
> How can i now re-require "my_class" without restarting irb?
> typing again the require command doesn't seem to reload MyClass:
>
>> require "my_class"
>
> Nothing happens! The class is not reloaded into memory.
>
> Please tell me somebody how I can refresh the required class!
>
load "myclass.rb"
>
>
> --
> Posted via
http://www.ruby-...
.
>
Erik Veenstra
8/6/2006 9:17:00 PM
0
> require "my_class"
>
> Nothing happens! The class is not reloaded into memory.
#".delete("my_class")
require "my_class"
gegroet,
Erik V. -
http://www.erikve...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
reloading required modules in irb
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password