Refactor centos-ruby-* images to avoid code duplication