Re-written shell version of hook for easier testing, including tests
Ruby version of the hook, including few tests