[rubygems/rubygems] util/rubocop -A --only Layout/MultilineBlockLayout

https://github.com/rubygems/rubygems/commit/9aa6101942
This commit is contained in:
Hiroshi SHIBATA 2023-03-16 12:22:51 +09:00
parent 9a1269eaaa
commit ae81ff0c9b
4 changed files with 6 additions and 10 deletions

View File

@ -17,8 +17,7 @@ class Gem::Commands::DependencyCommand < Gem::Command
add_prerelease_option add_prerelease_option
add_option("-R", "--[no-]reverse-dependencies", add_option("-R", "--[no-]reverse-dependencies",
"Include reverse dependencies in the output") do "Include reverse dependencies in the output") do |value, options|
|value, options|
options[:reverse_dependencies] = value options[:reverse_dependencies] = value
end end

View File

@ -65,8 +65,7 @@ module Gem::LocalRemoteOptions
def add_bulk_threshold_option def add_bulk_threshold_option
add_option(:"Local/Remote", "-B", "--bulk-threshold COUNT", add_option(:"Local/Remote", "-B", "--bulk-threshold COUNT",
"Threshold for switching to bulk", "Threshold for switching to bulk",
"synchronization (default #{Gem.configuration.bulk_threshold})") do "synchronization (default #{Gem.configuration.bulk_threshold})") do |value, _options|
|value, _options|
Gem.configuration.bulk_threshold = value.to_i Gem.configuration.bulk_threshold = value.to_i
end end
end end

View File

@ -24,8 +24,7 @@ module Gem::VersionOption
end end
add_option("--platform PLATFORM", Gem::Platform, add_option("--platform PLATFORM", Gem::Platform,
"Specify the platform of gem to #{task}", *wrap) do "Specify the platform of gem to #{task}", *wrap) do |value, options|
|value, options|
unless options[:added_platform] unless options[:added_platform]
Gem.platforms = [Gem::Platform::RUBY] Gem.platforms = [Gem::Platform::RUBY]
options[:added_platform] = true options[:added_platform] = true
@ -55,8 +54,7 @@ module Gem::VersionOption
end end
add_option("-v", "--version VERSION", Gem::Requirement, add_option("-v", "--version VERSION", Gem::Requirement,
"Specify version of gem to #{task}", *wrap) do "Specify version of gem to #{task}", *wrap) do |value, options|
|value, options|
# Allow handling for multiple --version operators # Allow handling for multiple --version operators
if options[:version] && !options[:version].none? if options[:version] && !options[:version].none?
options[:version].concat([value]) options[:version].concat([value])

View File

@ -207,8 +207,8 @@ class TestGemResolver < Gem::TestCase
s.add_development_dependency "b" s.add_development_dependency "b"
end end
b_spec = util_spec "b", 1 do b_spec = util_spec "b", 1 do |s|
|s| s.add_development_dependency "c" s.add_development_dependency "c"
end end
c_spec = util_spec "c", 1 c_spec = util_spec "c", 1