diff options
author | Andre Arko <andre@arko.net> | 2013-09-02 17:35:49 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2013-09-02 17:41:47 -0700 |
commit | 5048bf94f7b3c5e646eab7fef178adc32e308724 (patch) | |
tree | 072ab52bfadc7f7dacbe95c5e2760c09db30e34c | |
parent | b89e304cab8c92c969b0a700e5e66c114f23e58d (diff) | |
download | bundler-5048bf94f7b3c5e646eab7fef178adc32e308724.tar.gz |
store parallel install count in settings
-rw-r--r-- | lib/bundler/cli.rb | 1 | ||||
-rw-r--r-- | lib/bundler/installer.rb | 2 | ||||
-rw-r--r-- | spec/realworld/parallel_install_spec.rb | 5 |
3 files changed, 6 insertions, 2 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 60f996700c..09ed7d36c2 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -242,6 +242,7 @@ module Bundler Bundler.settings[:bin] = opts["binstubs"] if opts["binstubs"] Bundler.settings[:bin] = nil if opts["binstubs"] && opts["binstubs"].empty? Bundler.settings[:shebang] = opts["shebang"] if opts[:shebang] + Bundler.settings[:jobs] = opts["jobs"] if opts["jobs"] Bundler.settings[:no_prune] = true if opts["no-prune"] Bundler.settings[:clean] = opts[:clean] if opts[:clean] Bundler.settings.without = opts[:without] diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb index 8b642e6998..80427ff937 100644 --- a/lib/bundler/installer.rb +++ b/lib/bundler/installer.rb @@ -90,7 +90,7 @@ module Bundler # dependencies might actually affect the installation of a gem. # that said, it's a rare situation (other than rake), and parallel # installation is just SO MUCH FASTER. so we let people opt in. - jobs = [options[:jobs].to_i, 1].max + jobs = [Bundler.settings[:jobs].to_i, 1].max if jobs > 1 && can_install_parallely? install_in_parallel jobs, options[:standalone] else diff --git a/spec/realworld/parallel_install_spec.rb b/spec/realworld/parallel_install_spec.rb index 656d029bb3..c79febf161 100644 --- a/spec/realworld/parallel_install_spec.rb +++ b/spec/realworld/parallel_install_spec.rb @@ -4,16 +4,19 @@ describe "installing dependencies parallely", :realworld => true do it "installs gems parallely" do gemfile <<-G source "https://rubygems.org" - gem 'activesupport', '~> 3.2.13' gem 'faker', '~> 1.1.2' G bundle :install, :jobs => 4 + bundle "show activesupport" expect(out).to match(/activesupport/) bundle "show faker" expect(out).to match(/faker/) + + bundle "config jobs" + expect(out).to match(/: "4"/) end end |