sstephenson/rbenv — pull request #302 by sstephenson (2012-12-31 04:20:02+00:00)
Title: Support for .ruby-version files

This branch adds support for per-project `.ruby-version` files.

rbenv treats `.ruby-version` files the same way as it has always treated `.rbenv-version` files. A version specified in a `.ruby-version` file maps directly to a directory in `$RBENV_ROOT/versions`, without fuzzy version matching or other preprocessing (but with additional consideration for version names beginning with `ruby-`, as described below).

`.ruby-version` becomes the preferred file for storing local version specifications. The `rbenv version-file` command now prefers `.ruby-version` files when searching up the working directory tree. rbenv will still read versions specified in `.rbenv-version` if a `.ruby-version` file is not present.

Setting the local version with `rbenv local` now writes a `.ruby-version` file. If the local version was previously specified by `.rbenv-version`, rbenv will remove it and print a migration notice to stderr.

For compatibility with other version managers, if the version specification begins with `ruby-` but does not match a directory in `$RBENV_ROOT/versions`, rbenv will try to match it by removing the `ruby-` prefix. If a match is found, rbenv accepts it but prints a warning to stderr.

/cc @mislav @jeremy