This avoids `brew doctor` warnings on High Sierra but in general this is a good idea for future versions and to allow Homebrew developers to test things out with different versions of Ruby.
Move some `brew doctor` checks that are pretty macOS specific so they are only run on macOS.
os/mac/diagnostic