From: "Shot (Piotr Szotkowski)" Date: 2009-07-18T21:43:50+09:00 Subject: [ruby-core:24429] Re: __DIR__ follow up [RCR] --huq684BweRXVnRxX Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Roger Pack: > If that's the case, then perhaps providing something like > require_rel # require_relative > would be even more handy. You might want to try out Kernel=E2=80=99s require_relative in Ruby 1.9. :) Also, =E2=80=98Programming Ruby=E2=80=99 provides this implementation for R= uby 1.8: def require_relative(relative_feature) c =3D caller.first fail "Can't parse #{c}" unless c.rindex(/:\d+(:in `.*')?$/) file =3D $` if /\A\((.*)\)/ =3D~ file # eval, etc. raise LoadError, "require_relative is called in #{$1}" end absolute =3D File.expand_path(relative_feature, File.dirname(file)) require absolute end =E2=80=94 Shot --=20 Triskadekaphobiacs are presumably upset that, although 13.untrust appears to succeed and reinforce their beliefs, the state doesn=E2=80=99t stick; 13.un= trusted? subsequently returns false. Similarly, logicians and cynics alike must, respectively, rejoice and despair that true.untrust.untrusted? is perpetually false. [Run Paint Run Run, ruby-core] --huq684BweRXVnRxX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkphw4EACgkQi/mCfdEo8Up2WwCgyNTNVEtIfSDimVXPFvu9ikxZ SkAAnii6s24fY5TeudsC6Qmg/cqRLfjh =LPQt -----END PGP SIGNATURE----- --huq684BweRXVnRxX--