summaryrefslogtreecommitdiff
path: root/lib/rubygems/source.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/source.rb')
-rw-r--r--lib/rubygems/source.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/rubygems/source.rb b/lib/rubygems/source.rb
index 4ae84cf532..37e03cdfae 100644
--- a/lib/rubygems/source.rb
+++ b/lib/rubygems/source.rb
@@ -35,6 +35,7 @@ class Gem::Source
end
@uri = uri
+ @update_cache = nil
end
##
@@ -118,7 +119,8 @@ class Gem::Source
# Returns true when it is possible and safe to update the cache directory.
def update_cache?
- @update_cache ||=
+ return @update_cache unless @update_cache.nil?
+ @update_cache =
begin
File.stat(Gem.user_home).uid == Process.uid
rescue Errno::ENOENT