summaryrefslogtreecommitdiff
path: root/plugins/bundler/bundler.plugin.zsh
diff options
context:
space:
mode:
authorGuerki <pol.guerkinger@gmail.com>2014-07-29 09:27:58 +0200
committerGuerki <pol.guerkinger@gmail.com>2014-07-29 09:27:58 +0200
commit65ce765043e75ffb459763565f21df786022f092 (patch)
treebbc50582ee0a239c7adc143bc7ef5509e6177c4d /plugins/bundler/bundler.plugin.zsh
parentdb3dd6d755776daf19b55f6a1cae080ae684030a (diff)
parent207b6a1e338e03ba06cccf255fbaa7e6147e8f94 (diff)
downloadzsh-65ce765043e75ffb459763565f21df786022f092.tar.gz
zsh-65ce765043e75ffb459763565f21df786022f092.tar.bz2
zsh-65ce765043e75ffb459763565f21df786022f092.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'plugins/bundler/bundler.plugin.zsh')
-rw-r--r--plugins/bundler/bundler.plugin.zsh53
1 files changed, 47 insertions, 6 deletions
diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
index 20931dcef..617dcde71 100644
--- a/plugins/bundler/bundler.plugin.zsh
+++ b/plugins/bundler/bundler.plugin.zsh
@@ -5,15 +5,49 @@ alias bo="bundle open"
alias bu="bundle update"
alias bi="bundle_install"
-# The following is based on https://github.com/gma/bundler-exec
-
-bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard irb jekyll kitchen knife middleman nanoc puma rackup rainbows rake rspec ruby shotgun spec spin spork spring strainer tailor taps thin thor unicorn unicorn_rails)
+bundled_commands=(
+ annotate
+ cap
+ capify
+ cucumber
+ foodcritic
+ guard
+ irb
+ jekyll
+ kitchen
+ knife
+ middleman
+ nanoc
+ pry
+ puma
+ rackup
+ rainbows
+ rake
+ rspec
+ shotgun
+ sidekiq
+ spec
+ spork
+ spring
+ strainer
+ tailor
+ taps
+ thin
+ thor
+ unicorn
+ unicorn_rails
+)
# Remove $UNBUNDLED_COMMANDS from the bundled_commands list
for cmd in $UNBUNDLED_COMMANDS; do
bundled_commands=(${bundled_commands#$cmd});
done
+# Add $BUNDLED_COMMANDS to the bundled_commands list
+for cmd in $BUNDLED_COMMANDS; do
+ bundled_commands+=($cmd);
+done
+
## Functions
bundle_install() {
@@ -48,9 +82,17 @@ _within-bundled-project() {
false
}
+_binstubbed() {
+ [ -f "./bin/${1}" ]
+}
+
_run-with-bundler() {
if _bundler-installed && _within-bundled-project; then
- bundle exec $@
+ if _binstubbed $1; then
+ ./bin/$@
+ else
+ bundle exec $@
+ fi
else
$@
fi
@@ -63,7 +105,6 @@ for cmd in $bundled_commands; do
alias $cmd=bundled_$cmd
if which _$cmd > /dev/null 2>&1; then
- compdef _$cmd bundled_$cmd=$cmd
+ compdef _$cmd bundled_$cmd=$cmd
fi
done
-