MonkeeSage
12/15/2007 7:51:00 PM
On Dec 15, 1:19 pm, MonkeeSage <MonkeeS...@gmail.com> wrote:
> On Dec 14, 4:41 pm, Junkone <junko...@gmail.com> wrote:
>
> > hello
> > I have the following 2 files
>
> > Someopath/Dir1/File1.rb
> > Someopath/Dir2/File2.rb
>
> > How can i do a require 'relativepath/Dir2/File2.rb' from File1.rb
>
> > appreciate any help.
>
> $:.unshift(File.basename($0))
> require "../Dir2/File2.rb"
> require "../Dir3/File3.rb"
> require "../Dir4/File4.rb"
> ...
>
> Regards,
> Jordan
Heh...I'm not batting so well here. That should also have been
File.dirname, not basename! And probably the path should be expanded.
One more try here...
$:.unshift(File.expand_path(File.dirname($0)))
require "../../Dir2/File2.rb"
require "../../Dir3/File3.rb"
require "../../Dir4/File4.rb"
....
Regards,
Jordan