aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rw-r--r--rbenv/profile.d/rbenv.sh5
-rw-r--r--rbenv/shrc.d/plenv.sh21
3 files changed, 31 insertions, 0 deletions
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
+}