summaryrefslogtreecommitdiff
path: root/lib/rubygems/commands
diff options
context:
space:
mode:
authorHiroshi SHIBATA <[email protected]>2023-03-22 13:26:37 +0900
committerHiroshi SHIBATA <[email protected]>2023-03-23 17:18:49 +0900
commit0eef33e113e61f0d6efcf47f93602bd9d68f68d2 (patch)
tree1305402633da67630cf1ebfebbb6a630420108be /lib/rubygems/commands
parentbec069b0cae3934bb2caee3aad7fbf587ab95937 (diff)
[rubygems/rubygems] util/rubocop -A --only Style/Next
https://github.com/rubygems/rubygems/commit/e5868e92f7
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7582
Diffstat (limited to 'lib/rubygems/commands')
-rw-r--r--lib/rubygems/commands/dependency_command.rb7
-rw-r--r--lib/rubygems/commands/uninstall_command.rb13
2 files changed, 9 insertions, 11 deletions
diff --git a/lib/rubygems/commands/dependency_command.rb b/lib/rubygems/commands/dependency_command.rb
index b258cd3349..d047cb631e 100644
--- a/lib/rubygems/commands/dependency_command.rb
+++ b/lib/rubygems/commands/dependency_command.rb
@@ -89,10 +89,9 @@ use with other commands.
def display_pipe(specs) # :nodoc:
specs.each do |spec|
- unless spec.dependencies.empty?
- spec.dependencies.sort_by(&:name).each do |dep|
- say "#{dep.name} --version '#{dep.requirement}'"
- end
+ next if spec.dependencies.empty?
+ spec.dependencies.sort_by(&:name).each do |dep|
+ say "#{dep.name} --version '#{dep.requirement}'"
end
end
end
diff --git a/lib/rubygems/commands/uninstall_command.rb b/lib/rubygems/commands/uninstall_command.rb
index 74c11dd64b..6d34dd0149 100644
--- a/lib/rubygems/commands/uninstall_command.rb
+++ b/lib/rubygems/commands/uninstall_command.rb
@@ -167,15 +167,14 @@ that is a dependency of an existing gem. You can use the
gems_to_uninstall = {}
deps.each do |dep|
- unless gems_to_uninstall[dep.name]
- gems_to_uninstall[dep.name] = true
+ next if gems_to_uninstall[dep.name]
+ gems_to_uninstall[dep.name] = true
- unless original_gem_version[dep.name] == Gem::Requirement.default
- options[:version] = dep.version
- end
-
- uninstall_gem(dep.name)
+ unless original_gem_version[dep.name] == Gem::Requirement.default
+ options[:version] = dep.version
end
+
+ uninstall_gem(dep.name)
end
end