From: "T. Onoma" Date: 2003-12-11T06:12:17+09:00 Subject: Re: Ideas for replacing $0==__FILE__ On Wednesday 10 December 2003 09:15 pm, Hal Fulton wrote: > 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). > > How does that relate to the -t idea (which I don' quite get)? Kind of like this idea too. Basically what Eric is suggesting is that if you have an ruby file like, example.rb: # normal code here __SHELL__ # like, if $0 = __FILE__ # shell execution code here __TEST__ # test code here __END__ raw data here If one were to do % ruby -t example.rb it would run the code in the __TEST__ seciton rather than the __SHELL__ section. I can also think of another good section __CGI__ ;) T.