In article <48744.216.135.205.211.1071165104.squirrel / castle>,
 <jrb3 / eidogen.com> wrote:
>> On Thu, 11 Dec 2003 06:21:37 +0900, Eric Hodel wrote:
>> Why not:
>>
>> TEST {
>>   ...
>> }
>>
>> The block is only run with ruby -t ...; otherwise it works just like BEGIN
>> {} and END {} blocks.
>
>That makes good sense to me.  Looks cleaner inside and outside the file,
>makes the intent much clearer, and I don't have to go around setting stray
>executable bits (which CVS often strips off, causing me to write setup
>commands for otherwise unchanged library trees).

I like the if $0 == __FILE__ as it is, it's certainly not ugly enough to
inspire any grumbling from me.

I felt compelled to make a couple of comments:

* usually I don't have the executable bits turned on on my libraries,
  and they don't have #! lines.  This means I can't accidentally run
  them, and end up saying

    ruby foo.rb

  to test foo.rb

  my real programs don't usually have a .rb suffix (unless I have the
  same thing in multiple languages), do have the executable bit set,
  and have a #! line.

  This scheme works well for me, the only thing I need to remember is
  that when I start a new program without a suffix then gvim doesn't
  syntax highlight.  That's OK because I usually create an excutable
  file containing

    #!/usr/bin/env ruby

  as my first checkin for a program...

* In my experience CVS tries to maintain the execute bits as they were 
  when you added the file to the repository.  See
  http://mail.gnu.org/archive/html/info-cvs/2002-05/msg00190.html .
  It is possible to reset the execute bits if you have write access to
  the reporitory's file store - chmod +x foo.rb,v and then check it out.

Hope this helps,

Mike
-- 
mike / stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       | GPG PGP Key      1024D/059913DA 
mike / exegenix.com                  | Fingerprint      0570 71CD 6790 7C28 3D60
http://www.exegenix.com/           |                  75D2 9EC4 C1C0 0599 13DA