Can you write this Ruby?  Seems silly to use Python in a Ruby project, it's just one more dependency.