Always something new

After 5-6+ years of working with Ruby, I am still periodically reminded of features I’d forgotten about. Today it was the fact that you can override the backtick operator:

>> def `(cmd)
>>   puts "Do you really want to #{cmd}?"
>>   end
=> nil
>> `rm -rf *`
Do you really want to rm -rf *?
=> nil

Leave a Reply

Your email address will not be published. Required fields are marked *