diff options
| -rw-r--r-- | spec/bundler/spec_helper.rb | 1 | ||||
| -rw-r--r-- | spec/bundler/support/builders.rb | 10 |
2 files changed, 3 insertions, 8 deletions
diff --git a/spec/bundler/spec_helper.rb b/spec/bundler/spec_helper.rb index d750218452..a3a7b57356 100644 --- a/spec/bundler/spec_helper.rb +++ b/spec/bundler/spec_helper.rb @@ -27,6 +27,7 @@ require "rspec/core" require "rspec/expectations" require "rspec/mocks" require "rspec/support/differ" +require "rubygems/indexer" require_relative "support/builders" require_relative "support/checksums" diff --git a/spec/bundler/support/builders.rb b/spec/bundler/support/builders.rb index 5ca227cf5b..1283dc4348 100644 --- a/spec/bundler/support/builders.rb +++ b/spec/bundler/support/builders.rb @@ -279,14 +279,8 @@ module Spec @_build_path = "#{path}/gems" @_build_repo = File.basename(path) yield - with_gem_path_as scoped_base_system_gem_path do - Dir[scoped_base_system_gem_path.join("gems/rubygems-generate_index*/lib")].first || - raise("Could not find rubygems-generate_index lib directory in #{scoped_base_system_gem_path}") - - command = "generate_index" - command += " --no-compact" if !build_compact_index && gem_command(command + " --help").include?("--[no-]compact") - gem_command command, dir: path - end + options = { build_compact: build_compact_index } + Gem::Indexer.new(path, options).generate_index ensure @_build_path = nil @_build_repo = nil |
