From: Eric Hodel Date: 2003-12-10T13:21:35-08:00 Subject: Re: Ideas for replacing $0==__FILE__ --NQqDiQVflaif2hna Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hal Fulton (hal9000@hypermetrics.com) wrote: > >We also discussed on IRC having a "-t" flag to the ruby interpreter that > >would run a TEST block (like BEGIN or END or at_exit), but __TEST__ > >seems even better than that. >=20 > Are we talking about the same thing? In my scheme, if foo.rb had > a __TEST___ section, it would be run simply by ruby foo.rb (and > not run if foo.rb was require'd). This is different than your use. > How does that relate to the -t idea (which I don' quite get)? If you add -t to the ruby interpreter (ruby -t foo.rb) then __TEST__ get run when ruby exits. ($TEST would also be set like -d sets $DEBUG). --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --NQqDiQVflaif2hna Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQE/145fMypVHHlsnwQRAtt1AKC7+A5TCk0HB+BwDXVWUrh9IVcvjgCg5NCa mJ6/8I44SVRNZaxeAFzjSCM= =d5Vc -----END PGP SIGNATURE----- --NQqDiQVflaif2hna--