From: Benny Date: 2004-09-03T22:40:17+09:00 Subject: Re: [Design advice] including a file as code ('as is') Benny wrote: > Austin Ziegler wrote: > >> >> Look at Kernel#load; there's a wrap option. When Ruby requires or >> loads a file, the code in it is executed -- and then because you can >> wrap the loaded file in a module, you can then run it as well. >> > that's exactly what a was looking for!! > thanks! > > benny perhaps that was spoken too soon: I tried it, but I don't get the wrapper-module back. load only returns true or false, so have an anonymous module and can't do anything with it my idea was to do this #### code that doesn't work #### module My_Module ��������class�MyTest ����������������def�initialize(str) ������������������������puts�"initializing:�#{str}" ����������������end include load('include_me.rb', true) ��������end end but since load() returns true it won't work. am I missing something or is load() not the answer for my problem? benny