diff options
Diffstat (limited to 'plugins/bundler/bundler.plugin.zsh')
-rw-r--r-- | plugins/bundler/bundler.plugin.zsh | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index c5284dbb1..665cb5e43 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -14,6 +14,7 @@ bundled_commands=( cucumber foodcritic guard + hanami irb jekyll kitchen @@ -26,6 +27,7 @@ bundled_commands=( rainbows rake rspec + rubocop shotgun sidekiq spec @@ -53,10 +55,14 @@ done ## Functions bundle_install() { - if _bundler-installed && _within-bundled-project; then + if ! _bundler-installed; then + echo "Bundler is not installed" + elif ! _within-bundled-project; then + echo "Can't 'bundle install' outside a bundled project" + else local bundler_version=`bundle version | cut -d' ' -f3` if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then - if [[ "$OSTYPE" = darwin* ]] + if [[ "$OSTYPE" = (darwin|freebsd)* ]] then local cores_num="$(sysctl -n hw.ncpu)" else @@ -66,8 +72,6 @@ bundle_install() { else bundle install $@ fi - else - echo "Can't 'bundle install' outside a bundled project" fi } @@ -78,7 +82,7 @@ _bundler-installed() { _within-bundled-project() { local check_dir="$PWD" while [ "$check_dir" != "/" ]; do - [ -f "$check_dir/Gemfile" ] && return + [ -f "$check_dir/Gemfile" -o -f "$check_dir/gems.rb" ] && return check_dir="$(dirname $check_dir)" done false @@ -91,7 +95,7 @@ _binstubbed() { _run-with-bundler() { if _bundler-installed && _within-bundled-project; then if _binstubbed $1; then - ./bin/$@ + ./bin/${^^@} else bundle exec $@ fi |