On Sat, 16 Dec 2006, Eric Hodel wrote:

> On Dec 15, 2006, at 12:56, Giles Bowkett wrote:
>>> > Devin's solution gave me everything my app was using at the moment
>>> > I ran the command, but missed things which were used in the app but
>>> > not yet loaded.
>>> 
>>> I don't see how you could possibly expect to know what files would be
>>> loaded by your program in the future.
>> 
>> Well, that's the challenge, isn't it? It's only when you start to hack
>> time-travel knowledge discovery problems that you discover how truly
>> astounding Ruby's dynamicity is.
>> 
>> Seriously a human can do it just by looking at the source.
>
> Not accurately.  Load path manipulation or require order may cause files to
> be loaded  or not loaded contrary to your expectations.  Files may have been
> orphaned by the author, or your code may not need certain files, so they
> won't be required.

and, of course, it can be even more pathalogical

   require 'find'
   Find.find($:[rand($:.size)]{|e| break(require(e)) if rand > 0.42}

nevermind code generation and subsequent inclusion!

;-)

-a
-- 
if you find yourself slandering anybody, first imagine that your mouth is
filled with excrement.  it will break you of the habit quickly enough. - the
dalai lama