Once that’s done downloading and compiling, I simply use
chruby to switch to the new version.

chruby 2.2

Enumerable#slice_after

#slice_after is a counterpart to the already existing #slice_before

This method lets you split an enumerator with each item being grouped into a new
chunk when the result of the block is true. So in the example below, you can
see a new chunk is created after each odd number.

Enumerable#slice_when

This method allows you to slice the enumerable by comparing adjacent elements.
When the block is true a new chunk is created. Say you have an array of numbers
and you want to list them where subsequent numbers are grouped into ranges,
like “1, 5, 9-12, 15” for example.