aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/source.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/source.rb')
-rw-r--r--lib/rubygems/source.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/rubygems/source.rb b/lib/rubygems/source.rb
index ecfb6c8897..394ea6cf22 100644
--- a/lib/rubygems/source.rb
+++ b/lib/rubygems/source.rb
@@ -47,12 +47,7 @@ class Gem::Source
include Comparable
def ==(other)
- case other
- when self.class
- @uri == other.uri
- else
- false
- end
+ self.class === other and @uri == other.uri
end
alias_method :eql?, :==
@@ -71,7 +66,12 @@ class Gem::Source
end
def update_cache?
- @update_cache ||= File.stat(Gem.user_home).uid == Process.uid
+ @update_cache ||=
+ begin
+ File.stat(Gem.user_home).uid == Process.uid
+ rescue Errno::ENOENT
+ false
+ end
end
def fetch_spec(name)