Vladimir Dozen <Vladimir.Dozen / osw.com.ru> writes:

>    load "SimpleNearestNeighbourFinder.rb" if ...
>    load "BufferedNearestNeighbourFinder.rb" if ...
>    load "AdvancedNearestNeighbourFinder.rb" if ...
>    load @UserSuppliedName if ...
> 
>    ...
> 
>    nnf = NearestNeighbourFinder.new(...)

I see. In this case I think you have to override the default
Kernel::load. 

By default, kernel::load searches through directories mentioned in
$:. In the directory approach, just do $:.unshift
your_custom_search_path.

In the packaged approach, overload Kernel::load to check each element
of $: whether it is a directory or an archive. In the case of archive,
unzip it into some temp diretory and see if the file you want is
there. If you're using RubyZip, I don't think you need to unzip it. Of
course, if you find the file in the zipfile, you got to extract it out
since Kernel::load can't load from an archive. Once you find the file
you want in either directory or package, pass it to the default
Kernel::load (the one you override). The whole source code should be
shorter than this mail.

YS.