pyenv/libexec
Jason Karns c3a5f91ed0 create hook: version-origin
Expose a `version-origin` hook.

It is invoked *before* the traditional `rbenv-version-file` lookup. Because `version-origin` is traditionally run immediately after `version-name`, then any plugin hooks that alter `version-name` would have done so. Thus, running `version-origin` prior to printing the origin gives those plugins a chance to alter the `version-origin` to match.

If any of the hooks set `$RBENV_VERSION_ORIGIN`, then it is used as the return value. Otherwise, the existing logic continues to return "environment variable" or "filename" as appropriate.

This change, in conjunction with the `version-name` hook, makes a clean seam by which plugins can inject their own ruby version setting logic. Using this seam, as opposed to altering `$RBENV_COMMAND_PATH` from the `which` hook, means that the version name and origin are set more reliably and so `version`, `version-name`, `version-origin` and `which` all work as expected. Indeed, even PS1 works now.
2015-12-23 17:22:31 +01:00
..
rbenv Add rbenv's own rbenv.d directory to hook paths 2014-10-19 14:35:36 +02:00
rbenv---version tests galore 2013-03-07 15:07:32 -05:00
rbenv-commands fix iterating through paths that have spaces in them 2013-04-01 01:04:19 +02:00
rbenv-completions Fix detecting completions support on OpenBSD 2014-01-02 22:33:54 +01:00
rbenv-exec Speed up obtaining exec/which/whence completions 2014-10-15 01:24:45 +02:00
rbenv-global Improve syntax for inline documentation and allow for multi-line usage 2012-12-29 12:06:20 -06:00
rbenv-help Prefer gawk over awk if both are available. 2014-04-18 10:40:56 +10:00
rbenv-hooks Fail hard if RBENV_NATIVE_EXT is set but extensions failed to load 2014-10-13 04:12:35 +02:00
rbenv-init Merge pull request #528 from sstephenson/dylib 2014-10-15 18:19:54 +02:00
rbenv-local add tests for version commands 2013-04-08 23:16:35 +02:00
rbenv-prefix better error message for rbenv prefix system 2013-10-03 21:42:52 +02:00
rbenv-rehash Simplify the shims registration implementation in rbenv-rehash 2014-10-15 05:46:18 +02:00
rbenv-root Documentation tweaks 2012-12-29 22:05:04 -06:00
rbenv-sh-rehash Avoid invoking hash -r in fish 2013-10-31 20:18:14 +02:00
rbenv-sh-shell reliably detect parent shell in rbenv init 2013-10-07 03:24:45 +02:00
rbenv-shims tests galore 2013-03-07 15:07:32 -05:00
rbenv-version Documentation tweaks 2012-12-29 22:05:04 -06:00
rbenv-version-file Prefer .ruby-version to .rbenv-version for reading local versions 2012-12-30 18:35:20 -06:00
rbenv-version-file-read Add \r to IFS instead of removing it manually 2014-03-21 01:36:39 +01:00
rbenv-version-file-write Documentation tweaks 2012-12-29 22:05:04 -06:00
rbenv-version-name create hook: version-name 2015-12-23 17:22:30 +01:00
rbenv-version-origin create hook: version-origin 2015-12-23 17:22:31 +01:00
rbenv-versions Have versions emit a warning when no Ruby version was found 2014-10-13 04:02:04 +02:00
rbenv-whence Speed up obtaining exec/which/whence completions 2014-10-15 01:24:45 +02:00
rbenv-which Speed up obtaining exec/which/whence completions 2014-10-15 01:24:45 +02:00