From: Zhao Yi Date: 2009-01-05T14:49:24+09:00 Subject: Re: How can I prevent require duplicate files Phlip wrote: require() already prevents multiple includes. load() forces an > unquestioned input. > > If two modules require the same module... > > require 'foo' > > ...and if both modules specify the same path to foo (or no path), then > the file > only imports once. > > However, if you require some elaborate path, and if another module > requires a > different path to the same file, Ruby does not care if the file is the > same - it > will load() and execute the same source twice. If there are some variables defined in a module which is included by more than one files, there will be a warning indicating "warning: already initialized". If ruby only imports once, why such warning is thrown? -- Posted via http://www.ruby-forum.com/.