From: Shadowfirebird Date: 2008-07-24T20:31:01+09:00 Subject: Re: circular 'require' I apologise if I seem to be complaining. That's not it. I found a problem in what I was doing, worked out a way around it, and --partly since it involved a "gotcha" that I'd never seen explained anywhere else, partly because I'm still learning -- I posted it here to see if anyone had any comment, had a better idea. Pit, I think your solution is interesting because it imbeds a class definition inside a class. Are there any downsides to that? On Thu, Jul 24, 2008 at 12:00 PM, Pit Capitain wrote: > 2008/7/24 Sebastian Hungerecker : >> Just leave out the require 'root' and the whole thing will work. You're making >> things out to be way more complicated than they are. There is no need to >> require the file that requires you. > > Like the OP, I like to require files that are needed to execute the > current file, in order to not become dependent on the exact require > sequence. So another solution to the problem of his would be to place > the require calls at the appropriate places, for example in root.rb: > > class Root > > require 'customer' > def self.create_data() > Customer.new("Dolly") > Customer.new("Reymond") > end > > end > > But instead of reading and trying to understand what others have > posted he keeps complaining about require being broken. I don't see > anything in the documentation of require that doesn't behave as > advertised. > > Regards, > Pit > > -- Me, I imagine places that I have never seen / The colored lights in fountains, blue and green / And I imagine places that I will never go / Behind these clouds that hang here dark and low But it's there when I'm holding you / There when I'm sleeping too / There when there's nothing left of me / Hanging out behind the burned-out factories / Out of reach but leading me / Into the beautiful sea