Also apply patches for rubygems

Previously adding patches for rubygems would not actually patch the rubygems
source before installing because the patch action had not been defined for
rubygems. This means that if a ruby was being built with rubygems that needed
patching, for a CVE or a bugfix, the patch would not be applied. This commit
adds a do_patches method, copied verbatim out of the ruby18/ruby19 rake tasks,
and the do_patches method is then invoked during the rubygems install. With
this commit, patches can be added for rubygems in the same way they are added
for ruby18 and ruby19.