Permalink
Browse files

download gems with threads

  • Loading branch information...
1 parent 2c36c1b commit 61775d78da7c16aacb67aad8743824fde4651b43 @charliesome committed Jan 3, 2014
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/rubygems/request_set.rb
View
6 lib/rubygems/request_set.rb
@@ -117,7 +117,7 @@ def install options, &block # :yields: request, installer
specs = []
- sorted_requests.each do |req|
+ threads = sorted_requests.map { |req|
if req.installed? then
req.spec.spec.build_extensions
@@ -127,6 +127,10 @@ def install options, &block # :yields: request, installer
end
end
+ Thread.start { [req, req.download(cache_dir)] }
+ }
+
+ threads.compact.map(&:value).each do |req, path|
path = req.download cache_dir
inst = Gem::Installer.new path, options

0 comments on commit 61775d7

Please sign in to comment.