oh-my-fish/plugins/bundler/bundler.load
2014-11-01 18:23:02 +01:00

55 lines
1.5 KiB
Fish
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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
set -l do_eval (function --help | grep -q 'inheritvariable'; and echo false)
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
end
end
function __execute_as_bundler
if __is_a_bundled_executable $argv[1]
command bundle exec $argv
else
eval command $argv
end
end
function __is_a_bundled_executable
set -l bindir (command bundle exec ruby -e 'puts Gem.bindir')
test -f "$bindir/$argv"
end