aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/validator.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-21 10:20:47 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-21 10:20:47 +0000
commit5335ce0e060c7a2a0b01c57f8f8a64254f2658e1 (patch)
treec63321cb7c7c5c15454a79d81123c7188be2c51e /lib/rubygems/validator.rb
parent2f023c5dbaadede9ceac3eb9ac0e73f3050e5ada (diff)
downloadruby-5335ce0e060c7a2a0b01c57f8f8a64254f2658e1.tar.gz
Merge master branch from rubygems/rubygems upstream.
* Enable Style/MethodDefParentheses in Rubocop https://github.com/rubygems/rubygems/pull/2478 * Enable Style/MultilineIfThen in Rubocop https://github.com/rubygems/rubygems/pull/2479 * Fix required_ruby_version with prereleases and improve error message https://github.com/rubygems/rubygems/pull/2344 * Fix bundler rubygems binstub not properly looking for bundler https://github.com/rubygems/rubygems/pull/2426 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/validator.rb')
-rw-r--r--lib/rubygems/validator.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/rubygems/validator.rb b/lib/rubygems/validator.rb
index 6842e4fa9c..828497f700 100644
--- a/lib/rubygems/validator.rb
+++ b/lib/rubygems/validator.rb
@@ -62,7 +62,7 @@ class Gem::Validator
# Describes a problem with a file in a gem.
ErrorData = Struct.new :path, :problem do
- def <=> other # :nodoc:
+ def <=>(other) # :nodoc:
return nil unless self.class === other
[path, problem] <=> [other.path, other.problem]
@@ -94,13 +94,13 @@ class Gem::Validator
spec_path = spec.spec_file
gem_directory = spec.full_gem_path
- unless File.directory? gem_directory then
+ unless File.directory? gem_directory
errors[gem_name][spec.full_name] =
"Gem registered but doesn't exist at #{gem_directory}"
next
end
- unless File.exist? spec_path then
+ unless File.exist? spec_path
errors[gem_name][spec_path] = "Spec file missing for installed gem"
end
@@ -135,7 +135,7 @@ class Gem::Validator
source = File.join gem_directory, entry['path']
File.open source, Gem.binary_mode do |f|
- unless f.read == data then
+ unless f.read == data
errors[gem_name][entry['path']] = "Modified from original"
end
end
@@ -163,4 +163,3 @@ class Gem::Validator
errors
end
end
-