Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Support .ruby-version auto-switching in the root directory. #257

Merged
merged 1 commit into from

2 participants

@havenwood
Collaborator

Resolves #256.

@postmodern postmodern merged commit 4658959 into postmodern:master
@havenwood havenwood deleted the havenwood:root-dir-auto branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 5, 2014
  1. @havenwood
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 share/chruby/auto.sh
View
6 share/chruby/auto.sh
@@ -1,9 +1,11 @@
unset RUBY_AUTO_VERSION
function chruby_auto() {
- local dir="$PWD" version
+ local dir="$PWD/" version
until [[ -z "$dir" ]]; do
+ dir="${dir%/*}"
+
if { read -r version <"$dir/.ruby-version"; } 2>/dev/null || [[ -n "$version" ]]; then
if [[ "$version" == "$RUBY_AUTO_VERSION" ]]; then return
else
@@ -12,8 +14,6 @@ function chruby_auto() {
return $?
fi
fi
-
- dir="${dir%/*}"
done
if [[ -n "$RUBY_AUTO_VERSION" ]]; then
Something went wrong with that request. Please try again.