This is a multi-part message in MIME format.
------_=_NextPart_001_01C376D5.4988B134
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
hi,
consider a script foo.rb that contains the line
require './lib/lib.rb'
lib.rb contains the line:
require './lib/annother.rb'
it works.=20
(require 'annother.rb' doesn't work allthough the file annother.rb is =
placed in the same directory as lib.rb)
but i am not very pleased with it. the library in the directory lib, =
must not know from where it is required.
what can i do so that lib can require all it's files no matter where the =
script that requires lib.rb is located?
- henon
------_=_NextPart_001_01C376D5.4988B134
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.0.5762.3">
<TITLE>"require and subdirectories" problem</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=3D2 FACE=3D"Arial">hi,</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">consider a script foo.rb that contains =
the line</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">require './lib/lib.rb'</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">lib.rb contains the line:</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">require './lib/annother.rb'</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">it works. </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">(require 'annother.rb' doesn't =
work allthough the file annother.rb is placed in the same directory as =
lib.rb)</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">but i am not very pleased with it. the =
library in the directory lib, must not know from where it is =
required.</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">what can i do so that lib can require =
all it's files no matter where the script that requires lib.rb is =
located?</FONT>
</P>
<BR>
<P><FONT SIZE=3D2 FACE=3D"Arial">- henon</FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C376D5.4988B134--