Added Ruby gems script

Necessary to provide a single source of truth for installing Ruby
dependencies. This used to be managed by the Ruby Setup project but
that project is being deprecated in favor of this project.
This commit is contained in:
Brooke Kuhlmann
2021-03-14 14:08:18 -06:00
parent c62ef77ce2
commit be9edafe52
5 changed files with 52 additions and 0 deletions

View File

@@ -188,6 +188,19 @@ install_program() {
}
export -f install_program
# Installs Ruby.
# Parameters: None.
install_ruby() {
local version="$(cat $HOME/.ruby-version | tr -d '\n')"
if [[ ! -x "$(command -v ruby)" && -n $(ruby --version | grep --quiet "$version") ]]; then
$(get_homebrew_bin_root)/ruby-install "ruby-$version"
chruby "$version"
gem update --system && gem update
fi
}
export -f install_ruby
# Installs Rust.
# Parameters: None.
install_rust() {