draft solution -- for review only -- do not merge!

@haf while this is not valid Ruby (which I do not master), this will hopefully allow you to get the ideas of the proposed solution. Your comments are appreciated. 
Yes, I'm on OS X but build server is linux and I have Windows too.