detaching required scripts

M

MiG

Hello,

I was trying to remove required script (plugin) from memory via =20
remove_const.
It works fine but after that the require method doesn't require the scrip=
t =20
again.
It's because or $" array which contains already required file names.

Unfortunately the $" variable is read-only so I have to
1. temporarily rename the script, then require it or
2. use eval instead of require

Do you think is there a better solution?

thank you,
jan molic
 
L

Lyndon Samson

------=_Part_8671_332497.1126521395115
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

try load

------=_Part_8671_332497.1126521395115--
 
R

Robert Klemme

MiG said:
Hello,

I was trying to remove required script (plugin) from memory via
remove_const.
It works fine but after that the require method doesn't require the
script again.
It's because or $" array which contains already required file names.

Unfortunately the $" variable is read-only so I have to

You cannot assign $" but you can change the array:

13:08:03 [~]: ruby -r socket -e 'p $";$".delete "socket.so"; p $"'
["socket.so"]
[]

Kind regards

robert
 
J

Joel VanderWerf

MiG said:
Hello,

I was trying to remove required script (plugin) from memory via
remove_const.
It works fine but after that the require method doesn't require the
script again.
It's because or $" array which contains already required file names.

Unfortunately the $" variable is read-only so I have to
1. temporarily rename the script, then require it or
2. use eval instead of require

Do you think is there a better solution?

Check out my "script" lib on RAA.
 

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
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top