This avoids can avoid UID/EUID related issues with Ruby scripts passed
over `stdin` clashing with Ruby security features.
It's also just a bit nicer to have Ruby scripts in files instead.
While we're here:
- refactor some shared logic into a new `setup-gem-home-bundle-gemfile`
function in `ruby.sh`
- do some general cleanup of `lock.sh`
- prioritise `flock` over `python` in `lock.sh`
A new version of `shellcheck` (I think?) brought us so new warnings and
errors.
To fix:
- pass `--source-path` so we don't need to stop `shellcheck` trying to
read sourced files every time
- disable some more warnings/errors we don't care about fixing
Add a shim and a command that can be used to easily add a single
directory to your `PATH` (`Library/Homebrew/shims/gems`) and have it
automatically install, configure and run `rubocop` so you can use it
for in-editor integrations.