ruby gem to hook pre and post conditions to events