From: Magicloud Wang Date: 2007-12-26T05:53:43+09:00 Subject: Re: How to know what class are there in a script file? Dear, I will try this. Thanks. On 2007年12月25日Tuesday 19:50:09 BiHi wrote: > The activesupport Dependency thing is really nice since it works with > any constant, but if you really want the classes only, this seems to > do the trick: > > require 'enumerator' > > klasses_before = Enumerable::Enumerator.new(ObjectSpace, :each_object, > Class).to_a > > require 'open-uri' > > new_klasses = Enumerable::Enumerator.new(ObjectSpace, :each_object, > Class).to_a - klasses_before > > p new_klasses