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

This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.
No related posts.
