util/rubocop -A --only Style/TernaryParentheses
This commit is contained in:
parent
31c572f4fa
commit
f8fe151ca9
@ -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]
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
##
|
||||
|
@ -6,7 +6,7 @@ require "timeout"
|
||||
class TestGemStreamUI < Gem::TestCase
|
||||
# increase timeout with RJIT for --jit-wait testing
|
||||
rjit_enabled = defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled?
|
||||
SHORT_TIMEOUT = (RUBY_ENGINE == "ruby" && !rjit_enabled) ? 0.1 : 1.0
|
||||
SHORT_TIMEOUT = RUBY_ENGINE == "ruby" && !rjit_enabled ? 0.1 : 1.0
|
||||
|
||||
module IsTty
|
||||
attr_accessor :tty
|
||||
|
Loading…
x
Reference in New Issue
Block a user