Re: Re-implementing Autoload

2013-01-10 Thread Intransition
On Thursday, January 10, 2013 8:55:17 AM UTC-5, Xavier Noria wrote: > > > Exactly, dependencies.rb does the same as a know trade-off. > > The second bit const_missing lacks is the resolution algorithm that > failed to find the constant. > > Point is, while resolving X in > > module M >

Re: Re-implementing Autoload

2013-01-10 Thread Intransition
Thanks Xavier. I realize implementation differs. Clearly I can't tap into the underlying constant resolution with pure Ruby. But I expected that I should be able to emulate it effectively with const_missing --I would think it would possible to get essentially the same results. The only differen

Re: Re-implementing Autoload

2013-01-08 Thread Intransition
I was able to implement a hack: # if module has no name, try to parse out a namespace from #insepct. # (yes, this is a hack!) unless parent if name.nil? if /#/ =~ self.inspect parent = Object.const_get($1) rescue nil end end end That seems to