rbenv exec: avoid mutating PATH

Enables shelling out from a ruby process started with rbenv to a ruby
process with a different RBENV_VERSION. Fixes #121

This removes the workaround created for #15 and solves `ruby -S` support
by setting RUBYPATH. PATH is never changed.

To illustrate how RUBYPATH changes in various configurations:

    PATH=~/bin:~/.rbenv/shims:/usr/bin:/bin
    RBENV_VERSION=1.8 ruby -S rake
    #=> executes ~/.rbenv/versions/1.8/bin/rake
    #=> RUBYPATH=~/bin:~/.rbenv/versions/1.8/bin:/usr/bin:/bin

    RBENV_VERSION=2.0 ruby -S rake
    #=> executes ~/.rbenv/versions/2.0/bin/rake
    #=> RUBYPATH=~/bin:~/.rbenv/versions/2.0/bin:/usr/bin:/bin

    RBENV_VERSION=system ruby -S rake
    #=> executes /usr/bin/rake
    #=> RUBYPATH=~/bin:/rbenv_shims_were_here:/usr/bin:/bin

    RBENV_VERSION=1.8 ruby -S rake
    #=> executes ~/.rbenv/versions/1.8/bin/rake
    #=> RUBYPATH=~/bin:~/.rbenv/versions/1.8/bin:/usr/bin:/bin
Add more tests for version-file-read
Simplify version-file-read to avoid process substitution

Process substitution seems to be causing problems with some versions of
bash on specific systems.

Fixes #401
Merge branch 'no-process-substitution'
Merge pull request #372 from sstephenson/exec-next

Change `exec` semantics to allow using rbenv from a ruby process
Avoid invoking `hash -r` in fish

It doesn't exist as a builtin, and it doesn't seem there is a way to
detect support for a shell builtin that is portable. So, just detect
fish and don't the rehash command at all.

Fixes #478
Revert "rbenv exec: avoid mutating PATH"

It was supposed to fix shelling out to Ruby but it in fact broke another
kind of shelling out to Ruby: invoking the `ruby` binary directly with
the `-S` flag.

Fixes #480

This reverts commit db143bb654fe447a462b0d91ba931e0524f234f7.
ignore cache directory used by ruby-build
Improve `rbenv init` instructions for fish

Fish user config file `~/.config/fish/config.fish` loads for every
instance of fish shell, not just interactive ones. Since it's
unnecessary and dangerous to eval `rbenv init -` output in
non-interactive shells, wrap the invocation in a conditional that checks
if the current shell is interactive.

Fixes #501
Remove Neckbeard reference in favor of Advanced
Change 'Advanced Configuration' reference to 'How rbenv hooks into your shell'
Merge pull request #504 from jonathandean/master

Remove Neckbeard reference in favor of Advanced
Merge pull request #491 from peterhoeg/master

ignore cache directory used by ruby-build
Fix test suite when no system Ruby exists

Some tests assumed that the `ruby` executable will be found in system PATH.

Fixes #512, closes #514
Force TAP output from Bats on CI

In Travis CI environment, Bats thinks it's outputting to an interactive
terminal, so it switches to "pretty" format and ANSI escape codes which
don't look well in the final output.
Fixes rbenv on OpenBSD and any other systems that don't support head -c
Merge pull request #521 from wmoxam/master

Fix rbenv on OpenBSD

Fixes #519
Fix test suite running on OpenBSD

The error was "bash: no such file or directory" and it was due to bash
being located in `/usr/local/bin` on OpenBSD 5.4 instead of `/bin` like
on other systems.

Fixed by keeping `/usr/local/bin` in PATH during the test run.
Fix emulating the scenario where system Ruby is missing on OpenBSD

On other systems, we expected to find system Ruby in `/usr/bin`, but in
OpenBSD 5.4 it will be found in `/usr/local/bin`.

This replaces the limited USRBIN_ALT hack with a more generic
`path_without` function that will ensure that the given executable is
not present in the resulting PATH even if it's found in multiple
system paths.
Fix detecting completions support on OpenBSD

The non-extended regex pattern didn't work on OpenBSD so this switches
grep to extended pattern mode that seems to work consistenty on all
systems.