From: John Carter Date: 2006-12-07T06:19:43+09:00 Subject: Re: How to shoot yourself in the foot in Ruby On Thu, 7 Dec 2006, Edwin Fine wrote: > Jeremy Henty wrote: >> On 2006-12-05, Edwin Fine wrote: >> >>> How about a Ruby Quiz for the funniest way to shoot yourself in the >>> foot with Ruby? #!/bin/ruby -w me = File.read( __FILE__) open( __FILE__, 'w') do |f| f.syswrite( me.sub( /ruby -w/, 'sh')) end Although this works fairly well too... #!/bin/ruby -w me = File.read( __FILE__) open( __FILE__, 'w') do |f| f.syswrite( me.sub( /-w/, 'sh')) end John Carter Phone : (64)(3) 358 6639 Tait Electronics Fax : (64)(3) 359 4632 PO Box 1645 Christchurch Email : john.carter@tait.co.nz New Zealand