summaryrefslogtreecommitdiff
path: root/lib/rubygems/source.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-01-04 10:09:05 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-01-04 13:14:43 +0900
commit5537adf719a37a30b17d39111cc03700f353aa2d (patch)
tree7523de9950b8a0118143f4ee0029aee17d043e04 /lib/rubygems/source.rb
parent35c3a24c8cbcccff1108079360e2063fc354b4bd (diff)
downloadruby-5537adf719a37a30b17d39111cc03700f353aa2d.tar.gz
Track RubyGems master(3.3.0.dev) branch at 55634a8af18a52df86c4275d70fa1179118bcc20
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