Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
O
oh-my-fish
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
oh-my-fish
Commits
8a5acc8c
Commit
8a5acc8c
authored
Nov 02, 2014
by
Bruno
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #243 from JeanMertz/patch-1
Rewrite `bundle exec` wrapper to be more robust
parents
334fcb05
e83c710f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
20 deletions
+42
-20
plugins/bundler/bundler.load
plugins/bundler/bundler.load
+42
-20
No files found.
plugins/bundler/bundler.load
View file @
8a5acc8c
# The following is based on https://github.com/gma/bundler-exec
# 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
## Functions
function _bundler-installed
which bundle >/dev/null ^&1
end
set -l do_eval (function --help | grep -q '‐‐inherit‐variable'; and echo false)
function _within-bundled-project
set -l check_dir $PWD
while [ $check_dir != "/" ]
test -f "$check_dir/Gemfile"; and return
set check_dir (dirname $check_dir)
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
false
end
function _
run-with-
bundler
if
begin; _bundler-installed; and _within-bundled-project; end
function _
_execute_as_
bundler
if
__is_a_bundled_executable $argv[1]
command bundle exec $argv
else
eval command $argv
end
end
### Main program
set -l bundled_commands annotate cap capify cucumber dashing foreman guard middleman nanoc puma rackup rainbows rake rspec ruby shotgun sidekiq spec spinach spork thin thor unicorn unicorn_rails
for cmd in $bundled_commands
if not contains $cmd bundle gem
eval "function $cmd; _run-with-bundler $cmd \$argv;end"
end
function __is_a_bundled_executable
set -l bindir (command bundle exec ruby -e 'puts Gem.bindir')
test -f "$bindir/$argv"
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment