2014-11-01 17:23:02 +00:00
|
|
|
|
# These methods override the default calls to append `bundle exec` if this gem
|
|
|
|
|
# is available within the context of bundler.
|
|
|
|
|
#
|
|
|
|
|
set -l execs annotate \
|
|
|
|
|
cap \
|
|
|
|
|
capify \
|
|
|
|
|
cucumber \
|
|
|
|
|
dashing \
|
|
|
|
|
foreman \
|
|
|
|
|
guard \
|
|
|
|
|
kitchen \
|
|
|
|
|
middleman \
|
|
|
|
|
nanoc \
|
|
|
|
|
puma \
|
|
|
|
|
rackup \
|
|
|
|
|
rainbows \
|
|
|
|
|
rake \
|
|
|
|
|
rspec \
|
|
|
|
|
rubocop \
|
|
|
|
|
ruby \
|
|
|
|
|
shotgun \
|
|
|
|
|
sidekiq \
|
|
|
|
|
spec \
|
|
|
|
|
spinach \
|
|
|
|
|
spork \
|
|
|
|
|
thin \
|
|
|
|
|
thor \
|
|
|
|
|
unicorn \
|
|
|
|
|
unicorn_rails
|
2012-07-29 20:31:04 +00:00
|
|
|
|
|
2014-11-01 17:23:02 +00:00
|
|
|
|
set -l do_eval (function --help | grep -q '‐‐inherit‐variable'; and echo false)
|
2012-07-29 20:31:04 +00:00
|
|
|
|
|
2014-11-01 17:23:02 +00:00
|
|
|
|
for executable in $execs
|
|
|
|
|
if test -z "$do_eval"
|
|
|
|
|
eval "function $executable; __execute_as_bundler $executable \$argv; end"
|
|
|
|
|
else
|
|
|
|
|
function $executable --inherit-variable executable
|
|
|
|
|
__execute_as_bundler $executable $argv
|
|
|
|
|
end
|
2012-07-29 20:31:04 +00:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2014-11-01 17:23:02 +00:00
|
|
|
|
function __execute_as_bundler
|
|
|
|
|
if __is_a_bundled_executable $argv[1]
|
2012-07-29 20:31:04 +00:00
|
|
|
|
command bundle exec $argv
|
|
|
|
|
else
|
2012-11-03 13:28:33 +00:00
|
|
|
|
eval command $argv
|
2012-07-29 20:31:04 +00:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2014-11-01 17:23:02 +00:00
|
|
|
|
function __is_a_bundled_executable
|
|
|
|
|
set -l bindir (command bundle exec ruby -e 'puts Gem.bindir')
|
|
|
|
|
test -f "$bindir/$argv"
|
2012-07-29 20:31:04 +00:00
|
|
|
|
end
|