From 1646eb1ef78ddb739883e4c275266428acb882ef Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 8 Jun 2020 10:16:21 +1200 Subject: Add rbenv --- Makefile | 5 +++++ rbenv/profile.d/rbenv.sh | 5 +++++ rbenv/shrc.d/plenv.sh | 21 +++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 rbenv/profile.d/rbenv.sh create mode 100644 rbenv/shrc.d/plenv.sh diff --git a/Makefile b/Makefile index 2377abdb..0613ea05 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,7 @@ install-plenv \ install-psql \ install-pyenv \ + install-rbenv \ install-readline \ install-sh \ install-subversion \ @@ -538,6 +539,10 @@ install-pyenv: install-sh cp -p -- pyenv/profile.d/* $(HOME)/.profile.d cp -p -- pyenv/shrc.d/* $(HOME)/.shrc.d +install-rbenv: install-sh + cp -p -- rbenv/profile.d/* $(HOME)/.profile.d + cp -p -- rbenv/shrc.d/* $(HOME)/.shrc.d + install-readline: cp -p -- readline/inputrc $(HOME)/.inputrc diff --git a/rbenv/profile.d/rbenv.sh b/rbenv/profile.d/rbenv.sh new file mode 100644 index 00000000..52787b4d --- /dev/null +++ b/rbenv/profile.d/rbenv.sh @@ -0,0 +1,5 @@ +# Add rbenv to PATH and MANPATH if it appears to be in use +[ -d "$HOME"/.rbenv ] || return +PATH=$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH +MANPATH=$HOME/.rbenv/versions/$(ruby -e 'print "#{ RUBY_VERSION }"')/man:$MANPATH +export MANPATH diff --git a/rbenv/shrc.d/plenv.sh b/rbenv/shrc.d/plenv.sh new file mode 100644 index 00000000..ed9ddd03 --- /dev/null +++ b/rbenv/shrc.d/plenv.sh @@ -0,0 +1,21 @@ +# POSIX-compatible version of the rbenv Bash shell wrapper +[ -d "$HOME"/.rbenv ] || return +rbenv() { + case $1 in + rehash) + shift + eval "$(rbenv sh-rehash "$@")" + ;; + sh-rehash) + command rbenv "$@" + ;; + shell) + shift + eval "$(rbenv sh-shell "$@")" + ;; + *) + command rbenv "$@" + rbenv rehash + ;; + esac +} -- cgit v1.2.3