[rubygems/rubygems] util/rubocop -A --only Style/OrAssignment

https://github.com/rubygems/rubygems/commit/965fc82cfd
This commit is contained in:
Hiroshi SHIBATA 2023-03-16 13:55:04 +09:00
parent f4b073ef7a
commit bf69d1fc5d
3 changed files with 4 additions and 6 deletions

View File

@ -37,7 +37,7 @@ class Gem::Commands::UpdateCommand < Gem::Command
add_option("--system [VERSION]", Gem::Version, add_option("--system [VERSION]", Gem::Version,
"Update the RubyGems system software") do |value, options| "Update the RubyGems system software") do |value, options|
value = true unless value value ||= true
options[:system] = value options[:system] = value
end end

View File

@ -25,9 +25,7 @@ class Gem::Ext::Builder
# try to find make program from Ruby configure arguments first # try to find make program from Ruby configure arguments first
RbConfig::CONFIG["configure_args"] =~ /with-make-prog\=(\w+)/ RbConfig::CONFIG["configure_args"] =~ /with-make-prog\=(\w+)/
make_program_name = ENV["MAKE"] || ENV["make"] || $1 make_program_name = ENV["MAKE"] || ENV["make"] || $1
unless make_program_name make_program_name ||= RUBY_PLATFORM.include?("mswin") ? "nmake" : "make"
make_program_name = RUBY_PLATFORM.include?("mswin") ? "nmake" : "make"
end
make_program = Shellwords.split(make_program_name) make_program = Shellwords.split(make_program_name)
# The installation of the bundled gems is failed when DESTDIR is empty in mswin platform. # The installation of the bundled gems is failed when DESTDIR is empty in mswin platform.

View File

@ -136,9 +136,9 @@ module Gem::InstallUpdateOptions
add_option(:"Install/Update", "-g", "--file [FILE]", add_option(:"Install/Update", "-g", "--file [FILE]",
"Read from a gem dependencies API file and", "Read from a gem dependencies API file and",
"install the listed gems") do |v,_o| "install the listed gems") do |v,_o|
v = Gem::GEM_DEP_FILES.find do |file| v ||= Gem::GEM_DEP_FILES.find do |file|
File.exist? file File.exist? file
end unless v end
unless v unless v
message = v ? v : "(tried #{Gem::GEM_DEP_FILES.join ", "})" message = v ? v : "(tried #{Gem::GEM_DEP_FILES.join ", "})"