summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHiroshi SHIBATA <[email protected]>2023-03-16 13:35:34 +0900
committerHiroshi SHIBATA <[email protected]>2023-03-17 18:50:55 +0900
commit52ea7afa5f33d1a586866e0f12ede3b4a2a083e8 ()
treefff48f1513c01a8fa811e8fbb959d30b7372b807 /lib
parent9ab860f9afd6033d5fbf1cadd90c6e3aea396ee4 (diff)
[rubygems/rubygems] util/rubocop -A --only Style/NegatedIf
https://.com/rubygems/rubygems/commit/aa95ee27a2
-rw-r--r--lib/rubygems/commands/cert_command.rb2
-rw-r--r--lib/rubygems/query_utils.rb2
-rw-r--r--lib/rubygems/source.rb4
-rw-r--r--lib/rubygems/specification.rb4
-rw-r--r--lib/rubygems/specification_policy.rb6
-rw-r--r--lib/rubygems/user_interaction.rb4
6 files changed, 11 insertions, 11 deletions
@@ -135,7 +135,7 @@ class Gem::Commands::CertCommand < Gem::Command
end
def build(email)
- if !valid_email?(email)
raise Gem::CommandLineError, "Invalid email address #{email}"
end
@@ -84,7 +84,7 @@ module Gem::QueryUtils
installed = !installed unless options[:installed]
say(installed)
- exit_code = 1 if !installed
end
exit_code
@@ -44,12 +44,12 @@ class Gem::Source
Gem::Source::Vendor then
-1
when Gem::Source then
- if !@uri
return 0 unless other.uri
return 1
end
- return -1 if !other.uri
# Returning 1 here ensures that when sorting a list of sources, the
# original ordering of sources supplied by the user is preserved.
@@ -1616,8 +1616,8 @@ class Gem::Specification < Gem::BasicSpecification
# we need to fresh build when same name and version of default gems
return if self.class.find_by_full_name(full_name)&.default_gem?
return if File.exist? gem_build_complete_path
- return if !File.writable?(base_dir)
- return if !File.exist?(File.join(base_dir, "extensions"))
begin
# We need to require things in $LOAD_PATH without looking for the
@@ -125,7 +125,7 @@ class Gem::SpecificationPolicy
metadata.each do |key, value|
entry = "metadata['#{key}']"
- if !key.is_a?(String)
error "metadata keys must be a String"
end
@@ -133,7 +133,7 @@ class Gem::SpecificationPolicy
error "metadata key is too large (#{key.size} > 128)"
end
- if !value.is_a?(String)
error "#{entry} value must be a String"
end
@@ -368,7 +368,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
licenses = @specification.licenses
licenses.each do |license|
- if !Gem::Licenses.match?(license)
suggestions = Gem::Licenses.suggestions(license)
message = <<-WARNING
license value '#{license}' is invalid. Use a license identifier from
@@ -281,7 +281,7 @@ class Gem::StreamUI
# Ask a question. Returns an answer if connected to a tty, nil otherwise.
def ask(question)
- return nil if !tty?
@outs.print(question + " ")
@outs.flush
@@ -295,7 +295,7 @@ class Gem::StreamUI
# Ask for a password. Does not echo response to terminal.
def ask_for_password(question)
- return nil if !tty?
@outs.print(question, " ")
@outs.flush