Hi,

I have a problem with the require method.

First file 'main.rb':


> require 'test'
>
> class A
> 	def self.print
> 		p "test"
> 	end
> end
> 
> Test.print

Second file 'test.rb':

> require 'main'
> 
> class Test < A
> end

And the result during the execution :
workspace/test-divers/main.rb:10: uninitialized constant Test 
(NameError)

It's a simple example to show you the problem, but in a more complex
program, I have the same problem.
I think I understand what happen,
ruby begin to load main.rb, see the require 'test',
try to load test.rb, see the require 'main',
try to load main.rb with success, but when he arrived to
Test.print, ruby doesn't finish to load 'test.rb' and Test
become a uninitialized constant.

Thanks if you have a solution or a proposition.

--
Renaud Delbru

-- 
Posted via http://www.ruby-forum.com/.