Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

detaching required scripts

0 views
Skip to first unread message

MiG

unread,
Sep 12, 2005, 6:22:14 AM9/12/05
to
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?

thank you,
jan molic


Lyndon Samson

unread,
Sep 12, 2005, 6:36:38 AM9/12/05
to
try load

Robert Klemme

unread,
Sep 12, 2005, 7:09:18 AM9/12/05
to
MiG wrote:
> 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

Joel VanderWerf

unread,
Sep 12, 2005, 1:50:50 PM9/12/05
to

Check out my "script" lib on RAA.

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407


0 new messages