diff options
author | Kohei Suzuki <kohei-suzuki@cookpad.com> | 2013-05-14 11:57:13 +0900 |
---|---|---|
committer | Kohei Suzuki <kohei-suzuki@cookpad.com> | 2013-05-23 11:24:17 +0900 |
commit | a350159498ee55a146b4200f7da0373cecf8bc52 (patch) | |
tree | 9f05d7d81bfd43fef7267b8cff20f534479fb1f7 | |
parent | a671cc73c0cf035b9d0944bbfc16973ea4080112 (diff) | |
download | bundler-a350159498ee55a146b4200f7da0373cecf8bc52.tar.gz |
Add "--jobs, -j" option
-rw-r--r-- | lib/bundler/cli.rb | 3 | ||||
-rw-r--r-- | lib/bundler/installer.rb | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 69fed51be1..4b82c5b02f 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -174,6 +174,9 @@ module Bundler "Gem trust policy (like gem install -P). Must be one of " + Bundler.rubygems.security_policies.keys.join('|') unless Bundler.rubygems.security_policies.empty? + method_option "jobs", :aliases => "-j", :type => :numeric, :banner => + "Specify the number of jobs to run in parallel" + def install opts = options.dup if opts[:without] diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb index 8ee7402157..610ef83b86 100644 --- a/lib/bundler/installer.rb +++ b/lib/bundler/installer.rb @@ -90,7 +90,7 @@ module Bundler request_queue = Queue.new response_queue = Queue.new - size = 4 + size = options[:jobs] || 1 name2spec = {} threads = size.times.map do Thread.start do |