From fc6188d777c6111e71d8defa1da0674d48ae047f Mon Sep 17 00:00:00 2001 From: Paul Sorensen Date: Mon, 3 Feb 2014 10:30:23 -0600 Subject: [PATCH 1/2] Add bundle parallel config --- Rakefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Rakefile b/Rakefile index 6d026f1b..11aa1245 100644 --- a/Rakefile +++ b/Rakefile @@ -31,6 +31,8 @@ task :install => [:submodule_init, :submodules] do install_term_theme if RUBY_PLATFORM.downcase.include?("darwin") + run_bundle_config + success_msg("installed") end @@ -117,6 +119,29 @@ def run(cmd) `#{cmd}` unless ENV['DEBUG'] end +def number_of_cores + puts "======================================================" + puts "Calculating number of cores" + puts "======================================================" + + if RUBY_PLATFORM.downcase.include?("darwin") + cores = run %{ sysctl -n hw.ncpu } + else + cores = run %{ nproc } + end + puts + cores.to_i +end + +def run_bundle_config + bundler_jobs = number_of_cores - 1 + puts "======================================================" + puts "Configuring Bundlers for parallel gem installation" + puts "======================================================" + run %{ bundle config --global jobs #{bundler_jobs} } + puts +end + def install_rvm_binstubs puts "======================================================" puts "Installing RVM Bundler support. Never have to type" From 4ef213af3dc487e57069b7c725523d2dd278eb6d Mon Sep 17 00:00:00 2001 From: Paul Sorensen Date: Mon, 3 Feb 2014 12:04:47 -0600 Subject: [PATCH 2/2] Remove verbosity in core calculation --- Rakefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Rakefile b/Rakefile index 11aa1245..51e7ae18 100644 --- a/Rakefile +++ b/Rakefile @@ -120,10 +120,6 @@ def run(cmd) end def number_of_cores - puts "======================================================" - puts "Calculating number of cores" - puts "======================================================" - if RUBY_PLATFORM.downcase.include?("darwin") cores = run %{ sysctl -n hw.ncpu } else