diff options
| -rw-r--r-- | .bash/vars.bash | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/.bash/vars.bash b/.bash/vars.bash index 3bc68cd..29a3dfd 100644 --- a/.bash/vars.bash +++ b/.bash/vars.bash @@ -80,6 +80,20 @@ if command -v less >/dev/null;then export LESSANSIENDCHARS="m" export LESSANSIMIDCHARS="0123456789:;[?!\"'#%()*+ " fi + +# ----- RUBY ----- # +# Include local gems' binary path from those gems matching /usr/bin/ruby: +if [ -x '/usr/bin/ruby' ]; then + rubymajmin="$(/usr/bin/ruby -e 'print(RUBY_VERSION.gsub(%r{\.[0-9]+$}, '\'\''))')" + rubypath="${HOME}/.gem/ruby/${rubymajmin}.0/bin" + unset rubymajmin + if [ -d "$rubypath" ]; then + if ! printf '%b' "$PATH" | grep -P "(^|:)${rubypath}(:|$)" > /dev/null; then + PATH="${PATH}:$rubypath" + fi + fi +fi + # ----- MISC ----- # # nopaste export NOPASTE_SERVICES='pastebin nopaste' |
