summaryrefslogtreecommitdiff
path: root/lib/rubygems
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-03-16 13:52:28 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-03-17 18:50:55 +0900
commitf8fe151ca99233e7d133e2952f9b989c5290c825 (patch)
treeabf775744aa3065bc3686e7c8dab56d0954a113e /lib/rubygems
parent31c572f4fade8d061b151bd70dfca0b79da664e3 (diff)
util/rubocop -A --only Style/TernaryParentheses
Diffstat (limited to 'lib/rubygems')
-rw-r--r--lib/rubygems/ext/builder.rb2
-rw-r--r--lib/rubygems/local_remote_options.rb2
-rw-r--r--lib/rubygems/request.rb2
-rw-r--r--lib/rubygems/text.rb2
-rw-r--r--lib/rubygems/uri_formatter.rb2
5 files changed, 5 insertions, 5 deletions
diff --git a/lib/rubygems/ext/builder.rb b/lib/rubygems/ext/builder.rb
index 0386dc559b..af67fef502 100644
--- a/lib/rubygems/ext/builder.rb
+++ b/lib/rubygems/ext/builder.rb
@@ -29,7 +29,7 @@ class Gem::Ext::Builder
make_program = Shellwords.split(make_program_name)
# The installation of the bundled gems is failed when DESTDIR is empty in mswin platform.
- destdir = (/\bnmake/i !~ make_program_name || ENV["DESTDIR"] && ENV["DESTDIR"] != "") ? "DESTDIR=%s" % ENV["DESTDIR"] : ""
+ destdir = /\bnmake/i !~ make_program_name || ENV["DESTDIR"] && ENV["DESTDIR"] != "" ? "DESTDIR=%s" % ENV["DESTDIR"] : ""
env = [destdir]
diff --git a/lib/rubygems/local_remote_options.rb b/lib/rubygems/local_remote_options.rb
index 9751d9cd4c..8b6ff63be4 100644
--- a/lib/rubygems/local_remote_options.rb
+++ b/lib/rubygems/local_remote_options.rb
@@ -89,7 +89,7 @@ module Gem::LocalRemoteOptions
add_option(:"Local/Remote", "-p", "--[no-]http-proxy [URL]", URI::HTTP,
"Use HTTP proxy for remote operations") do |value, options|
- options[:http_proxy] = (value == false) ? :no_proxy : value
+ options[:http_proxy] = value == false ? :no_proxy : value
Gem.configuration[:http_proxy] = options[:http_proxy]
end
end
diff --git a/lib/rubygems/request.rb b/lib/rubygems/request.rb
index 5657f48e07..82c7f2b297 100644
--- a/lib/rubygems/request.rb
+++ b/lib/rubygems/request.rb
@@ -171,7 +171,7 @@ class Gem::Request
no_env_proxy = env_proxy.nil? || env_proxy.empty?
if no_env_proxy
- return (_scheme == "https" || _scheme == "http") ?
+ return _scheme == "https" || _scheme == "http" ?
:no_proxy : get_proxy_from_env("http")
end
diff --git a/lib/rubygems/text.rb b/lib/rubygems/text.rb
index 1cd466f997..da0795b771 100644
--- a/lib/rubygems/text.rb
+++ b/lib/rubygems/text.rb
@@ -66,7 +66,7 @@ module Gem::Text
str1.each_codepoint.with_index(1) do |char1, i|
j = 0
while j < m
- cost = (char1 == str2_codepoints[j]) ? 0 : 1
+ cost = char1 == str2_codepoints[j] ? 0 : 1
x = min3(
d[j + 1] + 1, # insertion
i + 1, # deletion
diff --git a/lib/rubygems/uri_formatter.rb b/lib/rubygems/uri_formatter.rb
index 3f1d02d774..7429570b71 100644
--- a/lib/rubygems/uri_formatter.rb
+++ b/lib/rubygems/uri_formatter.rb
@@ -34,7 +34,7 @@ class Gem::UriFormatter
# Normalize the URI by adding "http://" if it is missing.
def normalize
- (@uri =~ /^(https?|ftp|file):/i) ? @uri : "http://#{@uri}"
+ @uri =~ /^(https?|ftp|file):/i ? @uri : "http://#{@uri}"
end
##