R
Robert Klemme
2010/2/2 Alpha Blue said:Thanks for the clarification Robert and I like your distinction because
it makes more sense to me. =A0With your example in place, I am using
require and load statements correctly then. The only thing I've been
doing with regard to load statements is defining an absolute load path
rather than a relative load path. =A0Code execution in this example is th= e
loading of an xml source file (xrc) by wx_sugar.
Ah, OK. Then of course load is more appropriate.
This is strange because I don't know why I never thought about doing
this with Ruby. =A0I'm so used to keeping my projects separate and
therefore, I tend to keep the libs separate. =A0However, I could see
defining a libs dir for reusable library classes that I require in
future projects. =A0Then, all I would have to do is require and/or includ= e
the code I need. =A0Ocra does look over the rubyopt variables set at the
time of processing. =A0I'll have to check the $: to see that my custom li= b
directories are being set properly and included, but I can definitely
see this being a better way of implementing things later on. =A0I can
privatize and store all my libs on github for safekeeping and rdoc
everything for my own benefit.
Well, you can even have a mix of both: you can set RUBYLIB to your
"shared libs" folder and then in every main executable add an
appropriate folder of your local project. And we're back to the
original question IIRC. If you have to do that on multiple
machines though then it might be reasonable to use gems for
distribution and use the gems mechanism as storage for the shared
libs. But the principle would be the same.
It does - my thanks!
You're welcome!
Cheers
robert
--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/