diff options
author | Bodo Tasche <bodo@wannawork.de> | 2011-06-12 19:16:04 +0200 |
---|---|---|
committer | Hakan Ensari <hakan.ensari@papercavalier.com> | 2011-07-13 22:54:30 +0100 |
commit | 3aee5c19412dea541495e10f1c4cc7a6d8e4af50 (patch) | |
tree | 6ce8607e7265c6f6f52dea35de60a494580e08a9 /plugins/bundler-exec/bundler-exec.plugin.zsh | |
parent | 05883f383143fa4821a5b07a748a800c0299f1fd (diff) | |
download | zsh-3aee5c19412dea541495e10f1c4cc7a6d8e4af50.tar.gz zsh-3aee5c19412dea541495e10f1c4cc7a6d8e4af50.tar.bz2 zsh-3aee5c19412dea541495e10f1c4cc7a6d8e4af50.zip |
changed names of functions and variables to fit naming conventions
Diffstat (limited to 'plugins/bundler-exec/bundler-exec.plugin.zsh')
-rw-r--r-- | plugins/bundler-exec/bundler-exec.plugin.zsh | 18 |
1 files 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 |