diff options
author | Homu <homu@barosl.com> | 2016-03-30 14:21:21 +0900 |
---|---|---|
committer | Homu <homu@barosl.com> | 2016-03-30 14:21:21 +0900 |
commit | c3621778dc263b19c446908c7f5c5641aa6d4037 (patch) | |
tree | 3a2f9a742bd52d77a1485cb8de606f1fe9c58daf /spec | |
parent | b3b14b6732b5764d8d087032657ea3653467390d (diff) | |
parent | d4faf61a3a8a7655a9765596e1e811053f93ef8c (diff) | |
download | bundler-c3621778dc263b19c446908c7f5c5641aa6d4037.tar.gz |
Auto merge of #4413 - bundler:seg-speed-up-specs-update-repo, r=indirect
[Builders] Dont rebuild gem index when unnecessary
This should speed up the specs slightly
\c @indirect
Diffstat (limited to 'spec')
-rw-r--r-- | spec/support/builders.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/support/builders.rb b/spec/support/builders.rb index c43e410c88..54f6889be7 100644 --- a/spec/support/builders.rb +++ b/spec/support/builders.rb @@ -300,13 +300,13 @@ module Spec # A repo that has no pre-installed gems included. (The caller completely # determines the contents with the block.) - def build_repo4 + def build_repo4(&blk) FileUtils.rm_rf gem_repo4 - build_repo(gem_repo4) { yield } + build_repo(gem_repo4, &blk) end - def update_repo4 - update_repo(gem_repo4) { yield } + def update_repo4(&blk) + update_repo(gem_repo4, &blk) end def update_repo2 @@ -354,12 +354,14 @@ module Spec end def update_repo(path) + return unless block_given? @_build_path = "#{path}/gems" yield - @_build_path = nil with_gem_path_as Path.base_system_gems do Dir.chdir(path) { gem_command :generate_index } end + ensure + @_build_path = nil end def build_index(&block) |