Add rubygems_validate()

Stolen from @raggi adapted for RVM.
Merge pull request #1489 from envygeeks/patch-1

Add rubygems_validate()