summaryrefslogtreecommitdiff
path: root/lib/bundler/source/rubygems.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/source/rubygems.rb')
-rw-r--r--lib/bundler/source/rubygems.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index dca1d72577..fb5234cbb4 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -461,7 +461,7 @@ module Bundler
download_path = requires_sudo? ? Bundler.tmp(spec.full_name) : rubygems_dir
download_cache_path = "#{download_path}/cache"
- gem_path = "#{rubygems_dir}/cache/#{spec.full_name}.gem"
+ gem_path = "#{default_cache_path}/#{spec.full_name}.gem"
SharedHelpers.filesystem_access(download_cache_path) do |p|
FileUtils.mkdir_p(p)
@@ -469,7 +469,7 @@ module Bundler
download_gem(spec, download_cache_path)
if requires_sudo?
- SharedHelpers.filesystem_access("#{rubygems_dir}/cache") do |p|
+ SharedHelpers.filesystem_access(default_cache_path) do |p|
Bundler.mkdir_p(p)
end
Bundler.sudo "mv #{download_cache_path}/#{spec.full_name}.gem #{gem_path}"
@@ -492,6 +492,10 @@ module Bundler
Bundler.rubygems.gem_dir
end
+ def default_cache_path
+ "#{rubygems_dir}/cache"
+ end
+
def cache_path
Bundler.app_cache
end