From: Tuurlijk! Date: 2001-05-27T21:59:55+09:00 Subject: [ruby-talk:15798] Re: Splitting up a huge ruby file "Hal E. Fulton" wrote: > > ----- Original Message ----- > From: Chris Moline > To: ruby-talk ML > Sent: Saturday, May 26, 2001 8:10 PM > Subject: [ruby-talk:15786] Splitting up a huge ruby file > > > Hi, this is probably really obvious but I was wondering if ruby has a way > to > > split up a source file into several smaller ones but still have them > behave as > > if they were all in one file. The reason I ask is because I have some gtk > stuff > > that is getting pretty long. I have tried load, and require, and include > but > > none of those quite behave as I want. load is closest to what i want but i > can't > > access variables defined in another file. Any ideas?? It can use classes > and/or > > modules I am just not sure how to go about doing it. > > You could always do: > > eval(IO.read("myfile.rb")) > > There may be a better way. > > Hal Use one module to contain the contents of each seperate file. somefile.rb: module Evertything stuff inside the file end someotherfile.rb module Everything stuff inside the other file end Tuurlijk -- [-: mailto:tuurlijk@tuurlijk.eu.org :-] [-: http://tuurlijk.eu.org :-]