Have `versions` emit a warning when no Ruby version was found
Add tests for non-directory types under `RBENV_ROOT/versions/`
Speed up `realpath()` with dynamically loaded C extension

On systems that support both C compiling and dynamic loading, we can
speed up `realpath()` (where most time in rbenv is spent) by replacing
it with a dynamically loaded bash builtin.

When `make -C src` is called in the project's root,
`libexec/rbenv-realpath.dylib` will be created. If it exists, rbenv will
attempt to load it as a builtin command. If it fails, execution will
fall back to the old `realpath()` shell function.
Fix hooks tests on OS X by expanding BATS_TMPDIR

With `realpath` extension, hooks tests on OS X will output
`/private/tmp` instead of `/tmp` because the latter is an actual symlink
to the former.

Avoid this mistmach in output assertions by expanding BATS_TMPDIR if
`realpath` extension is compiled.
Avoid slow `abs_dirname()` by loading `realpath` extension

This speeds up every `rbenv` invocation significantly.
Stop using `abs_dirname()` in rbenv-init

It's slow and not necessary since we expect `$0` to already be expanded.

In tests this change forces us to deal with some relative paths, but
it's not a big deal. The `rbenv init -` output in the most common case
will be the same as before:

    source '/home/myuser/.rbenv/libexec/../completions/rbenv.bash'
Test compiled native extensions on Travis CI
Fail hard if RBENV_NATIVE_EXT is set but extensions failed to load
Try without `-current_version`

Seems to only work on OS X; fails on Travis
https://travis-ci.org/sstephenson/rbenv/jobs/16384866
Import `shobj-conf` script from bash

Given the `-o <HOST-OS>` parameter, the script generates environment
variables with information how to compile dynamically loadable libraries
for that system.

Imported from bash-3.2.48
Fix `shobj-conf` on Darwin

The `shobj-conf` script imported from bash seems to not support the
latest OS X. This makes sure that `SHOBJ_LDFLAG=-dynamiclib` is output
for Darwin10+ (latest version is Darwin 13.0).
Create `configure` script to generate a cross-platform Makefile

The previous Makefile only worked on OS X. The dynamically generated
Makefile (from `Makefile.in`) should now work on multiple platforms
(tested on OS X and Ubuntu).
Fall back to `cc` as default compiler when `gcc` is not available
Merge branch 'blank-versions'

Fixes #626
Avoid `rbenv-exec` calling out to `rbenv-version-name` twice

Running any shim (and thus `rbenv-exec`) would always execute
`rbenv-version-name` twice: once in `rbenv-exec` and another time in
`rbenv-which`, even though RBENV_VERSION variable would have already
been populated at this point.

Now RBENV_VERSION is respected within `rbenv-which`.
Improve performance of rbenv-which when RBENV_VERSION=system

This implements removing of the shims path element via bash
substitution, instead of jumping around in all the `$PATH` elements.
Clean up PATH sanitization in rbenv-which
Merge branch 'speedup-which'

Closes #560
Isolate rbenv-which tests from any `.ruby-version` file on the system

Having a `.ruby-version` file in any of the parent directories of the
local clone of rbenv could cause the test suite to fail because it
wasn't expecting a local version to be set.

Fixes #533
Speed up obtaining `exec/which/whence` completions

Delegate to `rbenv-shims` instead of `rbenv shims` and therefore skip
going through the main `rbenv` executable again that would set up a lot
of the environment that was already set.