From 87dd5fe2c03377e41ecf765d6d273e2bd8b5b995 Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Tue, 17 Nov 2015 14:27:05 -0500 Subject: [PATCH 1/6] indentation --- libexec/rbenv | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/libexec/rbenv b/libexec/rbenv index dd68cdfe..8d2fc732 100755 --- a/libexec/rbenv +++ b/libexec/rbenv @@ -28,26 +28,26 @@ if enable -f "${BASH_SOURCE%/*}"/../libexec/rbenv-realpath.dylib realpath 2>/dev else [ -z "$RBENV_NATIVE_EXT" ] || abort "failed to load \`realpath' builtin" -READLINK=$(type -p greadlink readlink | head -1) -[ -n "$READLINK" ] || abort "cannot find readlink - are you missing GNU coreutils?" + READLINK=$(type -p greadlink readlink | head -1) + [ -n "$READLINK" ] || abort "cannot find readlink - are you missing GNU coreutils?" -resolve_link() { - $READLINK "$1" -} + resolve_link() { + $READLINK "$1" + } -abs_dirname() { - local cwd="$(pwd)" - local path="$1" + abs_dirname() { + local cwd="$(pwd)" + local path="$1" - while [ -n "$path" ]; do - cd "${path%/*}" - local name="${path##*/}" - path="$(resolve_link "$name" || true)" - done + while [ -n "$path" ]; do + cd "${path%/*}" + local name="${path##*/}" + path="$(resolve_link "$name" || true)" + done - pwd - cd "$cwd" -} + pwd + cd "$cwd" + } fi if [ -z "${RBENV_ROOT}" ]; then From a1ef9efc80e606e43d157b1ad029d6836d7bcc87 Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Tue, 17 Nov 2015 15:09:09 -0500 Subject: [PATCH 2/6] use PWD var over pwd command --- libexec/rbenv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libexec/rbenv b/libexec/rbenv index 8d2fc732..795a2e9a 100755 --- a/libexec/rbenv +++ b/libexec/rbenv @@ -36,7 +36,7 @@ else } abs_dirname() { - local cwd="$(pwd)" + local cwd="$PWD" local path="$1" while [ -n "$path" ]; do @@ -58,10 +58,10 @@ fi export RBENV_ROOT if [ -z "${RBENV_DIR}" ]; then - RBENV_DIR="$(pwd)" + RBENV_DIR="$PWD" else cd "$RBENV_DIR" 2>/dev/null || abort "cannot change working directory to \`$RBENV_DIR'" - RBENV_DIR="$(pwd)" + RBENV_DIR="$PWD" cd "$OLDPWD" fi export RBENV_DIR From f85c41b14f420d6c216afb81d8e7683b32737ffd Mon Sep 17 00:00:00 2001 From: ReadmeCritic Date: Wed, 25 Nov 2015 10:08:28 -0800 Subject: [PATCH 3/6] Update README URLs based on HTTP redirects --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b32e4102..adf22f9a 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ bulletproof deployments. **Rock-solid in production.** Your application's executables are its interface with ops. With rbenv and [Bundler - binstubs](https://github.com/sstephenson/rbenv/wiki/Understanding-binstubs) + binstubs](https://github.com/rbenv/rbenv/wiki/Understanding-binstubs) you'll never again need to `cd` in a cron job or Chef recipe to ensure you've selected the right runtime. The Ruby version dependency lives in one place—your app—so upgrades and rollbacks are @@ -24,12 +24,12 @@ bulletproof deployments. you tailor it to suit your needs. Compile your own Ruby versions, or use the [ruby-build][] plugin to automate the process. Specify per-application environment - variables with [rbenv-vars](https://github.com/sstephenson/rbenv-vars). + variables with [rbenv-vars](https://github.com/rbenv/rbenv-vars). See more [plugins on the - wiki](https://github.com/sstephenson/rbenv/wiki/Plugins). + wiki](https://github.com/rbenv/rbenv/wiki/Plugins). [**Why choose rbenv over -RVM?**](https://github.com/sstephenson/rbenv/wiki/Why-rbenv%3F) +RVM?**](https://github.com/rbenv/rbenv/wiki/Why-rbenv%3F) ## Table of Contents @@ -453,8 +453,8 @@ Tests are executed using [Bats](https://github.com/sstephenson/bats): $ bats test/.bats Please feel free to submit pull requests and file bugs on the [issue -tracker](https://github.com/sstephenson/rbenv/issues). +tracker](https://github.com/rbenv/rbenv/issues). - [ruby-build]: https://github.com/sstephenson/ruby-build#readme - [hooks]: https://github.com/sstephenson/rbenv/wiki/Authoring-plugins#rbenv-hooks + [ruby-build]: https://github.com/rbenv/ruby-build#readme + [hooks]: https://github.com/rbenv/rbenv/wiki/Authoring-plugins#rbenv-hooks From df4c16ecb4b70036db181d526efaeb044df0b648 Mon Sep 17 00:00:00 2001 From: Chulki Lee Date: Mon, 7 Dec 2015 11:03:07 -0800 Subject: [PATCH 4/6] update urls to rbenv --- README.md | 4 ++-- bin/ruby-local-exec | 2 +- libexec/rbenv-help | 2 +- test/--version.bats | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index adf22f9a..7b023676 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ easy to fork and contribute any changes back upstream. 1. Check out rbenv into `~/.rbenv`. ~~~ sh - $ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv + $ git clone https://github.com/rbenv/rbenv.git ~/.rbenv ~~~ 2. Add `~/.rbenv/bin` to your `$PATH` for access to the `rbenv` @@ -444,7 +444,7 @@ name | default | description ## Development The rbenv source code is [hosted on -GitHub](https://github.com/sstephenson/rbenv). It's clean, modular, +GitHub](https://github.com/rbenv/rbenv). It's clean, modular, and easy to understand, even if you're not a shell hacker. Tests are executed using [Bats](https://github.com/sstephenson/bats): diff --git a/bin/ruby-local-exec b/bin/ruby-local-exec index 97d0a3df..de57897c 100755 --- a/bin/ruby-local-exec +++ b/bin/ruby-local-exec @@ -16,7 +16,7 @@ export RBENV_DIR="${1%/*}" [ -n "$RBENV_SILENCE_WARNINGS" ] || { echo "rbenv: \`ruby-local-exec' is deprecated and will be removed in the next release." - echo " To upgrade: https://github.com/sstephenson/rbenv/wiki/ruby-local-exec" + echo " To upgrade: https://github.com/rbenv/rbenv/wiki/ruby-local-exec" echo } >&2 diff --git a/libexec/rbenv-help b/libexec/rbenv-help index c899cf0d..e5013d3d 100755 --- a/libexec/rbenv-help +++ b/libexec/rbenv-help @@ -152,7 +152,7 @@ if [ -z "$1" ] || [ "$1" == "rbenv" ]; then print_summaries commands local global shell install uninstall rehash version versions which whence echo echo "See \`rbenv help ' for information on a specific command." - echo "For full documentation, see: https://github.com/sstephenson/rbenv#readme" + echo "For full documentation, see: https://github.com/rbenv/rbenv#readme" else command="$1" if [ -n "$(command_path "$command")" ]; then diff --git a/test/--version.bats b/test/--version.bats index 9993e6dc..3d7ad5c7 100644 --- a/test/--version.bats +++ b/test/--version.bats @@ -49,7 +49,7 @@ git_commit() { mkdir -p "$RBENV_ROOT" cd "$RBENV_ROOT" git init - git remote add origin https://github.com/sstephenson/rbenv.git + git remote add origin https://github.com/rbenv/rbenv.git git_commit git tag v0.4.1 git_commit @@ -65,7 +65,7 @@ git_commit() { mkdir -p "$RBENV_ROOT" cd "$RBENV_ROOT" git init - git remote add origin https://github.com/sstephenson/rbenv.git + git remote add origin https://github.com/rbenv/rbenv.git git_commit cd "$RBENV_TEST_DIR" From 3c7a13d81f9c2eb8566778d2fa28eaae4dd70812 Mon Sep 17 00:00:00 2001 From: Kohei Suzuki Date: Sat, 12 Dec 2015 15:28:34 +0900 Subject: [PATCH 5/6] Remove leading `:` --- libexec/rbenv-which | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libexec/rbenv-which b/libexec/rbenv-which index f4d46245..c7c0301a 100755 --- a/libexec/rbenv-which +++ b/libexec/rbenv-which @@ -23,7 +23,8 @@ remove_from_path() { path_before="$result" result="${result//:$path_to_remove:/:}" done - echo "${result%:}" + result="${result%:}" + echo "${result#:}" } RBENV_COMMAND="$1" From 90373d78b91484b738d57f2bb54c6b417c95e182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Mon, 14 Dec 2015 11:59:01 +0100 Subject: [PATCH 6/6] Add test for not including current directory in PATH search Confirms #836 --- test/which.bats | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/which.bats b/test/which.bats index 25c80528..004852f1 100644 --- a/test/which.bats +++ b/test/which.bats @@ -56,6 +56,16 @@ create_executable() { assert_success "${RBENV_TEST_DIR}/bin/kill-all-humans" } +@test "doesn't include current directory in PATH search" { + export PATH="$(path_without "kill-all-humans")" + mkdir -p "$RBENV_TEST_DIR" + cd "$RBENV_TEST_DIR" + touch kill-all-humans + chmod +x kill-all-humans + RBENV_VERSION=system run rbenv-which kill-all-humans + assert_failure "rbenv: kill-all-humans: command not found" +} + @test "version not installed" { create_executable "2.0" "rspec" RBENV_VERSION=1.9 run rbenv-which rspec