aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/%HOME%/.bash_utils/ruby.sh
blob: 86c2c279535fa84ebc371abe9d9a5de1c0809676 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env bash

update_ruby_settings() {
    local user_dir
    local bin_dir

    command -v ruby &> /dev/null                       \
        && command -v gem &> /dev/null                 \
        && user_dir="$( ruby -e 'puts Gem.user_dir' )" \
        && export GEM_HOME="$user_dir"                 \
        && bin_dir="$( ruby -e 'puts Gem.bindir' )"    \
        && add_path "$bin_dir"
}

update_ruby_settings