summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2018-04-08 20:07:53 +0000
committerThe Bundler Bot <bot@bundler.io>2018-04-08 20:07:53 +0000
commitba49ed283fa20d313f95cdefcd32f8f82a786c9f (patch)
tree907a8ba32f96465e9bc2f8abc89955d8baa540d5 /lib
parentcecdfdb5b2a76133b0a83093ff6d80d1ffd97b46 (diff)
parent8bf9c1f8f4bcebd67967f4ae5e3985b5880fed6d (diff)
downloadbundler-ba49ed283fa20d313f95cdefcd32f8f82a786c9f.tar.gz
Auto merge of #6480 - bundler:segiddins/6475-install-path-dot, r=indirect
[Source::RubyGems] Allow installing when the path is `.` ### What was the end-user problem that led to this PR? The problem was `bundle install` would fail when the path was configured to be the current working directory. Fixes #6475. ### What was your diagnosis of the problem? My diagnosis was `Gem::RemoteFetcher` caches `.gem` files differently when `Dir.pwd == download_dir` ### What is your fix for the problem, implemented in this PR? My fix moves the file rubygems has downloaded to the cache directory we expect. ### Why did you choose this fix out of the possible options? I chose this fix because it does not re-implement logic in rubygems, and it keeps the directory structure bundler generates consistent.
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/source/rubygems.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 72dbc0c588..1759838b57 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -485,7 +485,10 @@ module Bundler
else
uri = spec.remote.uri
Bundler.ui.confirm("Fetching #{version_message(spec)}")
- Bundler.rubygems.download_gem(spec, uri, download_path)
+ rubygems_local_path = Bundler.rubygems.download_gem(spec, uri, download_path)
+ if rubygems_local_path != local_path
+ FileUtils.mv(rubygems_local_path, local_path)
+ end
cache_globally(spec, local_path)
end
end