From 3aee5c19412dea541495e10f1c4cc7a6d8e4af50 Mon Sep 17 00:00:00 2001 From: Bodo Tasche Date: Sun, 12 Jun 2011 19:16:04 +0200 Subject: [PATCH] changed names of functions and variables to fit naming conventions --- plugins/bundler-exec/bundler-exec.plugin.zsh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/bundler-exec/bundler-exec.plugin.zsh b/plugins/bundler-exec/bundler-exec.plugin.zsh index cfab16c5e..4684dcb8d 100644 --- a/plugins/bundler-exec/bundler-exec.plugin.zsh +++ b/plugins/bundler-exec/bundler-exec.plugin.zsh @@ -5,26 +5,26 @@ bundled_commands=(cucumber heroku rackup rails rake rspec ruby shotgun spec spor ## Functions -bundler-installed() +_bundler-installed() { which bundle > /dev/null 2>&1 } -within-bundled-project() +_within-bundled-project() { - local dir="$(pwd)" - while [ "$(dirname $dir)" != "/" ]; do - [ -f "$dir/Gemfile" ] && return - dir="$(dirname $dir)" + local check_dir=$PWD + while [ "$(dirname $check_dir)" != "/" ]; do + [ -f "$check_dir/Gemfile" ] && return + dir="$(dirname $check_dir)" done false } -run-with-bundler() +_run-with-bundler() { local command="$1" shift - if bundler-installed && within-bundled-project; then + if _bundler-installed && _within-bundled-project; then bundle exec $command "$@" else $command "$@" @@ -33,5 +33,5 @@ run-with-bundler() ## Main program for cmd in $bundled_commands; do - alias $cmd="run-with-bundler $cmd" + alias $cmd="_run-with-bundler $cmd" done