Commit 4d8319bd authored by Mislav Marohnić's avatar Mislav Marohnić
Browse files

Call `rbenv-*` subcommands directly, not through the `rbenv` executable

Benefits:
- makes it easier to stub `rbenv-*` subcommands in tests
- speeds up subcommands because it skips the main `rbenv` executable

Caveats:
- users are no longer able to call `bin/rbenv-install` or
  `rbenv-uninstall` directly
parent 501855c9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ unset VERSION_NAME
# version is specified by rbenv. Show usage instructions if a local
# version is not specified.
DEFINITION="${ARGUMENTS[0]}"
[ -n "$DEFINITION" ] || DEFINITION="$(rbenv local 2>/dev/null || true)"
[ -n "$DEFINITION" ] || DEFINITION="$(rbenv-local 2>/dev/null || true)"
[ -n "$DEFINITION" ] || usage 1


@@ -154,7 +154,7 @@ fi
# REE installer requires an existing Ruby installation to run. An
# unsatisfied local .ruby-version file can cause the installer to
# fail.)
export RBENV_VERSION="$(rbenv global 2>/dev/null || true)"
export RBENV_VERSION="$(rbenv-global 2>/dev/null || true)"


# Execute `before_install` hooks.
@@ -193,7 +193,7 @@ for hook in "${after_hooks[@]}"; do eval "$hook"; done

# Run `rbenv-rehash` after a successful installation.
if [ "$STATUS" == "0" ]; then
  rbenv rehash
  rbenv-rehash
else
  cleanup
fi
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ for hook in "${before_hooks[@]}"; do eval "$hook"; done

if [ -d "$PREFIX" ]; then
  rm -rf "$PREFIX"
  rbenv rehash
  rbenv-rehash
fi

for hook in "${after_hooks[@]}"; do eval "$hook"; done