Explorar el Código
Merge pull request #1069 from viclim/fix-issue-1065
Ignore empty `.ruby-version` files
pull/1133/head
Mislav Marohnić
hace 6 años
cometido por
GitHub
No se encontró ninguna clave conocida en la base de datos para esta firma
ID de clave GPG: 4AEE18F83AFDEB23
Se han
modificado 3 ficheros con
3 adiciones y
3 borrados
-
libexec/rbenv-version-file
-
test/version-file.bats
-
test/version-origin.bats
|
|
@ -9,7 +9,7 @@ target_dir="$1" |
|
|
|
find_local_version_file() { |
|
|
|
local root="$1" |
|
|
|
while ! [[ "$root" =~ ^//[^/]*$ ]]; do |
|
|
|
if [ -f "${root}/.ruby-version" ]; then |
|
|
|
if [ -s "${root}/.ruby-version" ]; then |
|
|
|
echo "${root}/.ruby-version" |
|
|
|
return 0 |
|
|
|
fi |
|
|
|
|
|
@ -9,7 +9,7 @@ setup() { |
|
|
|
|
|
|
|
create_file() { |
|
|
|
mkdir -p "$(dirname "$1")" |
|
|
|
touch "$1" |
|
|
|
echo "system" > "$1" |
|
|
|
} |
|
|
|
|
|
|
|
@test "detects global 'version' file" { |
|
|
|
|
|
@ -26,7 +26,7 @@ setup() { |
|
|
|
} |
|
|
|
|
|
|
|
@test "detects local file" { |
|
|
|
touch .ruby-version |
|
|
|
echo "system" > .ruby-version |
|
|
|
run rbenv-version-origin |
|
|
|
assert_success "${PWD}/.ruby-version" |
|
|
|
} |
|
|
|