I rewrote the original shell script to Ruby. (Practicing)
Just a little modification