diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-08-15 17:07:48 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-08-17 17:08:51 +0900 |
commit | aef5509139abd34f9983fa00895f91ea2801f088 (patch) | |
tree | afdb051ba5fa4f197648189853366b57bcf5f493 /spec/bundler/support/helpers.rb | |
parent | 20af44c27727333b4cd3eef9d5b18daaa0445f0e (diff) | |
download | ruby-aef5509139abd34f9983fa00895f91ea2801f088.tar.gz |
[bundler/bundler] Extract single gem installation logic
https://github.com/bundler/bundler/commit/7888d621c8
Diffstat (limited to 'spec/bundler/support/helpers.rb')
-rw-r--r-- | spec/bundler/support/helpers.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb index 4a0a07244c..a46292665b 100644 --- a/spec/bundler/support/helpers.rb +++ b/spec/bundler/support/helpers.rb @@ -314,14 +314,18 @@ module Spec "#{gem_repo}/gems/#{g}.gem" end - raise "OMG `#{path}` does not exist!" unless File.exist?(path) - - gem_command! :install, "--no-document --ignore-dependencies '#{path}'" + install_gem(path) bundler_path && bundler_path.rmtree end end + def install_gem(path) + raise "OMG `#{path}` does not exist!" unless File.exist?(path) + + gem_command! :install, "--no-document --ignore-dependencies '#{path}'" + end + def with_gem_path_as(path) backup = ENV.to_hash ENV["GEM_HOME"] = path.to_s |