summaryrefslogtreecommitdiff
path: root/plugins/bundler-exec/bundler-exec.plugin.zsh
diff options
context:
space:
mode:
authorHakan Ensari <hakan.ensari@papercavalier.com>2011-07-13 22:41:09 +0100
committerHakan Ensari <hakan.ensari@papercavalier.com>2011-07-13 22:54:30 +0100
commit60e104acd1710c04057d079cfa5ac9316762f580 (patch)
tree67cfa7d6a948375502bc5c9309c47ea884c6bae7 /plugins/bundler-exec/bundler-exec.plugin.zsh
parenta77e6fb003cc80fbbff5d453a5ca3d38638d99ed (diff)
downloadzsh-60e104acd1710c04057d079cfa5ac9316762f580.tar.gz
zsh-60e104acd1710c04057d079cfa5ac9316762f580.tar.bz2
zsh-60e104acd1710c04057d079cfa5ac9316762f580.zip
merge bundler and bundle-exec plugins
Diffstat (limited to 'plugins/bundler-exec/bundler-exec.plugin.zsh')
-rw-r--r--plugins/bundler-exec/bundler-exec.plugin.zsh34
1 files changed, 0 insertions, 34 deletions
diff --git a/plugins/bundler-exec/bundler-exec.plugin.zsh b/plugins/bundler-exec/bundler-exec.plugin.zsh
deleted file mode 100644
index 3417ea81c..000000000
--- a/plugins/bundler-exec/bundler-exec.plugin.zsh
+++ /dev/null
@@ -1,34 +0,0 @@
-# This plugin is based on https://github.com/gma/bundler-exec
-# modify the bundled_commands if needed
-
-bundled_commands=(cap capify cucumber heroku rackup rails rake rspec ruby shotgun spec spork thin unicorn unicorn_rails)
-
-## Functions
-
-_bundler-installed() {
- which bundle > /dev/null 2>&1
-}
-
-_within-bundled-project() {
- local check_dir=$PWD
- while [ "$(dirname $check_dir)" != "/" ]; do
- [ -f "$check_dir/Gemfile" ] && return
- check_dir="$(dirname $check_dir)"
- done
- false
-}
-
-_run-with-bundler() {
- local command="$1"
- shift
- if _bundler-installed && _within-bundled-project; then
- bundle exec $command "$@"
- else
- $command "$@"
- fi
-}
-
-## Main program
-for cmd in $bundled_commands; do
- alias $cmd="_run-with-bundler $cmd"
-done