Added https source for rubygems
Use a case statement instead of ifelses
Extracted four_oh_four method