Redo python shim script in ruby