rewriting force-save from shell to ruby