Asfand Yar Qazi schrieb:
> I want to be able to do the following:
> 
> lots of Ruby files are in a directory, each containing stuff and a 
> method 'init_file'.  I want to be able to 'require' each file, and then 
> call the 'init_file' method within that file.
> 
> Each file will have its own 'init_file' method, so I can't just do a:
> 
> require 'file'
> init_file
> 
> because the init_file method will have been defined before hand.

Not that I would recommend that, but you can do

   require 'file1'
   init_file

   require 'file2'
   init_file

because the init_file method of file2 will overwrite the init_file method of file1.

But: of course this is bad style. Where do your Ruby files come from? Can't you 
wrap the code in each file in a class or module?

Regards,
Pit