If you end up messing with traps a lot in Ruby, you’ll find that they don’t unbind when leaving function context, so you’re either stuck ‘ensuring’ that the trap is replaced by the old trap, or just dealing with it. Well, here’s a quick monkeypatch for adding a method that will do all the ensuring/retrapping […]