[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Unloading (or unrequiring) a file

Ari Brown

8/17/2007 10:59:00 PM

Hey all,

I'm trying to dynamically load parts of code to make things and
methods available.

The catch is that I'd also like to make those things and methods
UNavailable as well (or load something else in place of the original
loaded item).

I know there's no Kernel#unload, so how can I achieve my goal?


Thanks,
aRi
-------------------------------------------|
Nietzsche is my copilot



6 Answers

Logan Capaldo

8/17/2007 11:15:00 PM

0

On 8/17/07, Ari Brown <ari@aribrown.com> wrote:
> Hey all,
>
> I'm trying to dynamically load parts of code to make things and
> methods available.
>
> The catch is that I'd also like to make those things and methods
> UNavailable as well (or load something else in place of the original
> loaded item).
>
> I know there's no Kernel#unload, so how can I achieve my goal?
>
As far as methods go there's remove_method and undef_method. For
constants theres remove_const. An idea I've had was to fork, although
that's a little heavy handed

eg:

... code ...
pid = fork do
require 'this_will_go_away'
but_so_will_this_var = ThisWillGoAway.new
but_so_will_this_var.do_something
end

Process.wait pid

p but_so_will_this_var # NameError

>
> Thanks,
> aRi
> -------------------------------------------|
> Nietzsche is my copilot
>
>
>
>

TrinhQuocThien

2/15/2011 5:27:00 PM

0

Tha(`ng a(n cho^.m Dinh Van Ninh gia? khu`ng dde^? tro^'n toa` Santa
Clara pha.t va. !

We knows that!

Tha'ng na`y go+?i tie^`n bo^`i thu+o+`ng chu+a ha? ma^.y ?

QTTT
+++++++++++++++++++++++++++++++++++++++++++++++++++
> Tha(`ng a(n ca('p Trinhquoc Thieng ddi su*?a ma('t mu~i dde^? tro^'n
> li'nh ne^n bie^'n ra tha(`ng Thien D Tran
>
> KEKEKEKEKEKEK :)))
>
> On Feb 15, 8:42 am, hotac <hochim...@gmail.com> wrote:> On Feb 15, 11:30 am, Dr. Nách <ChuyenTriHOIN...@hotmail.com> wrote:
>
> > >http://www.cbsnews.com/2300-204_162-10006001.htm...
>
> .> As resulted from Dr. Tri's malpractice ????
>
>
>
>
>
> > ;-))- Hide quoted text -
>
> - Show quoted text -

hotac

2/15/2011 5:36:00 PM

0

On Feb 15, 12:26 pm, TrinhQuocThien <trinhquocth...@gmail.com> wrote:
> Tha(`ng a(n cho^.m Dinh Van Ninh gia? khu`ng dde^? tro^'n toa` Santa
> Clara pha.t va. !
>
> We knows that!
>
> Tha'ng na`y go+?i tie^`n bo^`i thu+o+`ng chu+a ha? ma^.y ?
>
> QTTT
> +++++++++++++++++++++++++++++++++++++++++++++++++++
>

Tha(`ng Thie^'n Heo noa'i Obama mo+`i da`o the White House (dde^? mo`
ma^'y con maid) trong lu'c gia ddi`nh o^ng ta ddi nghi~ ma't o+?
Hawaii.

Gia^'y mo+`i dda^u ma`y?
Tra? tie^`n ngu? ma^'y con maid, RECEIPT dda^u ma`y?

Scan bo? le^n coi na`o !!!

Dr. Nách

2/15/2011 6:00:00 PM

0

Thie^n D Tran ddu*'ng ngoa`i vo`ng ra`o xem Obama a(n lunch be`n to`
te moi lunch box cu?a mi`nh ra khu'c ba'nh mi` thi.t ga(.p cho ddo*~
the`m ro^`i ve^` nha` mo*? cu*?a vo^~ bu.ng pha`nh pha.ch no'i vo*'i
con me. ddi~ mamason "Oh my love dear, I have a very gu't lunch with
Obama today"


Kekekekekekek :))

On Feb 15, 9:35 am, hotac <hochim...@gmail.com> wrote:
> On Feb 15, 12:26 pm, TrinhQuocThien <trinhquocth...@gmail.com> wrote:
>
> > Tha(`ng a(n cho^.m Dinh Van Ninh gia? khu`ng dde^? tro^'n toa` Santa
> > Clara pha.t va. !
>
> > We knows that!
>
> > Tha'ng na`y go+?i tie^`n bo^`i thu+o+`ng chu+a ha? ma^.y ?
>
> > QTTT
> > +++++++++++++++++++++++++++++++++++++++++++++++++++
>
..> Tha(`ng Thie^'n Heo noa'i Obama mo+`i da`o the White House (dde^?
mo`
> ma^'y con maid) trong lu'c gia ddi`nh o^ng ta ddi nghi~ ma't o+?
> Hawaii.
>
..> Gia^'y mo+`i dda^u ma`y?
> Tra? tie^`n ngu? ma^'y con maid, RECEIPT dda^u ma`y?
>
> Scan bo? le^n coi na`o !!!

TrinhQuocThien

2/15/2011 10:13:00 PM

0

Ma`y la` tha(`ng ku? ca(.c na`o ma` ddo`i coi gia^'y mo+`i cu?a
EOP ? ;-)))

Sao ho^m ddo' ma`y kho^ng to+'i ddu+'ng tru+o+'c co^?ng dde^? soa't
gia^'y hay coi ke' gia^'y mo+`i !? ;-)))))))))))))))

We really had fun ! ;-))))))))))))))

Thanks for the invitation from EOP ! ;-))))

QTTT
On Feb 15, 12:35 pm, hotac <hochim...@gmail.com> wrote:
> On Feb 15, 12:26 pm, TrinhQuocThien <trinhquocth...@gmail.com> wrote:
>
> > Tha(`ng a(n cho^.m Dinh Van Ninh gia? khu`ng dde^? tro^'n toa` Santa
> > Clara pha.t va. !
>
> > We knows that!
>
> > Tha'ng na`y go+?i tie^`n bo^`i thu+o+`ng chu+a ha? ma^.y ?
>
> > QTTT
> > +++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Tha(`ng Thie^'n Heo noa'i Obama mo+`i da`o the White House (dde^? mo`
> ma^'y con maid) trong lu'c gia ddi`nh o^ng ta ddi nghi~ ma't o+?
> Hawaii.
>
> Gia^'y mo+`i dda^u ma`y?
> Tra? tie^`n ngu? ma^'y con maid, RECEIPT dda^u ma`y?
>
> Scan bo? le^n coi na`o !!!

Lambada

2/16/2011 12:54:00 AM

0

Oh no !

No blowJob plzzz :)))



On Feb 15, 2:12 pm, TrinhQuocThien <trinhquocth...@gmail.com> wrote:
> Ma`y la` tha(`ng ku? ca(.c na`o ma` ddo`i coi gia^'y mo+`i cu?a
> EOP ? ;-)))
>
> Sao ho^m ddo' ma`y kho^ng to+'i ddu+'ng tru+o+'c co^?ng dde^? soa't
> gia^'y hay coi ke' gia^'y mo+`i  !? ;-)))))))))))))))
>
..> We really had fun !   ;-))))))))))))))
>
> Thanks for the invitation from EOP !  ;-))))
>
> QTTT
> On Feb 15, 12:35 pm, hotac <hochim...@gmail.com> wrote:
>
>
>
>
>
>
>
> > On Feb 15, 12:26 pm, TrinhQuocThien <trinhquocth...@gmail.com> wrote:
>
> > > Tha(`ng a(n cho^.m Dinh Van Ninh gia? khu`ng dde^? tro^'n toa` Santa
> > > Clara pha.t va. !
>
> > > We knows that!
>
> > > Tha'ng na`y go+?i tie^`n bo^`i thu+o+`ng chu+a ha? ma^.y ?
>
> > > QTTT
> > > +++++++++++++++++++++++++++++++++++++++++++++++++++
>
> > Tha(`ng Thie^'n Heo noa'i Obama mo+`i da`o the White House (dde^? mo`
> > ma^'y con maid) trong lu'c gia ddi`nh o^ng ta ddi nghi~ ma't o+?
> > Hawaii.
>
> > Gia^'y mo+`i dda^u ma`y?
> > Tra? tie^`n ngu? ma^'y con maid, RECEIPT dda^u ma`y?
>
> > Scan bo? le^n coi na`o !!!