From be4cc74e26d463358c121820fb6f918b9b8de92d Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 16 Mar 2023 14:05:21 +0900 Subject: [PATCH] [rubygems/rubygems] util/rubocop -A --only Style/IfUnlessModifierOfIfUnless https://github.com/rubygems/rubygems/commit/97e0af2518 --- lib/rubygems/commands/update_command.rb | 4 +++- lib/rubygems/specification.rb | 4 +++- lib/rubygems/validator.rb | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/rubygems/commands/update_command.rb b/lib/rubygems/commands/update_command.rb index d1c0a32ece..837972a8e7 100644 --- a/lib/rubygems/commands/update_command.rb +++ b/lib/rubygems/commands/update_command.rb @@ -185,7 +185,9 @@ command to remove old versions. system Gem.ruby, "--disable-gems", "setup.rb", *args end - say "RubyGems system software updated" if installed unless options[:silent] + unless options[:silent] + say "RubyGems system software updated" if installed + end end end diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index 7aa76b40f6..8d2a14ffee 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -1136,7 +1136,9 @@ class Gem::Specification < Gem::BasicSpecification result = {} specs.reverse_each do |spec| - next if spec.version.prerelease? unless prerelease + unless prerelease + next if spec.version.prerelease? + end result[spec.name] = spec end diff --git a/lib/rubygems/validator.rb b/lib/rubygems/validator.rb index a288eaaae1..76a6d7909e 100644 --- a/lib/rubygems/validator.rb +++ b/lib/rubygems/validator.rb @@ -62,7 +62,9 @@ class Gem::Validator errors = Hash.new {|h,k| h[k] = {} } Gem::Specification.each do |spec| - next unless gems.include? spec.name unless gems.empty? + unless gems.empty? + next unless gems.include? spec.name + end next if spec.default_gem? gem_name = spec.file_name