Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chruby to known ruby version managers #361

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion modules/ruby/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ if [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
# Source RVM.
source "$HOME/.rvm/scripts/rvm"

# Load chruby into the shell session
elif [[ -s "/usr/local/share/chruby/chruby.sh" ]]; then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded paths are not going to work.

source "/usr/local/share/chruby/chruby.sh"
source "/usr/local/share/chruby/auto.sh"

# Load manually installed rbenv into the shell session.
elif [[ -s "$HOME/.rbenv/bin/rbenv" ]]; then
path=("$HOME/.rbenv/bin" $path)
Expand All @@ -32,7 +37,7 @@ else
fi

# Return if requirements are not found.
if (( ! $+commands[ruby] && ! ( $+commands[rvm] || $+commands[rbenv] ) )); then
if (( ! $+commands[ruby] && ! ( $+commands[rvm] || $+commands[rbenv] || $+commands[chruby] ) )); then
return 1
fi

Expand Down