refactors nil checkers to a helper method in gemifier.rb