This rbenv plugin very simply sets the number of jobs bundler is allowed to do simultaneously based on the number of cores in your machine. The meat of this logic is here.
The rbenv specific stuff in this plugin comes from rbenv-default-gems and rbenv-ctags.