e99a8fb9c22b42dff9fdc8f93ef87ce8b856361c
- Author
- Robby Russell <robby@planetargon.com>
- Committer
- Robby Russell <robby@planetargon.com>
- Date
Message
Merge pull request #2080 from Mehonoshin/bundler-parallel-installing
Support of parallel bundle install
Diff
1diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
2index c01241409dca69f25a5aad53fd624ac731c33cbb..1e70db6afe9898f970c45b00e9b79c62ce586b73 100644
3--- a/plugins/bundler/bundler.plugin.zsh
4+++ b/plugins/bundler/bundler.plugin.zsh
5@@ -1,10 +1,17 @@
6 alias be="bundle exec"
7-alias bi="bundle install"
8 alias bl="bundle list"
9 alias bp="bundle package"
10 alias bo="bundle open"
11 alias bu="bundle update"
12
13+if [[ "$(uname)" == 'Darwin' ]]
14+then
15+ local cores_num="$(sysctl hw.ncpu | awk '{print $2}')"
16+else
17+ local cores_num="$(nproc)"
18+fi
19+eval "alias bi='bundle install --jobs=$cores_num'"
20+
21 # The following is based on https://github.com/gma/bundler-exec
22
23 bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard jekyll kitchen knife middleman nanoc rackup rainbows rake rspec ruby shotgun spec spin spork strainer tailor thin thor unicorn unicorn_rails puma)
24@@ -42,3 +49,4 @@ for cmd in $bundled_commands; do
25 compdef _$cmd bundled_$cmd=$cmd
26 fi
27 done
28+