ruby-changes:66176
From: Hiroshi <ko1@a...>
Date: Wed, 12 May 2021 17:25:25 +0900 (JST)
Subject: [ruby-changes:66176] 129bc04ab7 (master): [rubygems/rubygems] util/rubocop -a
https://git.ruby-lang.org/ruby.git/commit/?id=129bc04ab7 From 129bc04ab7fb36f8a9e89cbe0264918bd7cc1d02 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA <hsbt@r...> Date: Tue, 11 May 2021 16:45:31 +0900 Subject: [rubygems/rubygems] util/rubocop -a https://github.com/rubygems/rubygems/commit/a10ff97830 --- lib/rubygems/test_case.rb | 6 +++--- test/rubygems/test_gem_commands_help_command.rb | 2 +- test/rubygems/test_gem_package_tar_writer.rb | 16 ++++++++-------- test/rubygems/test_gem_request_set.rb | 2 +- test/rubygems/test_gem_specification.rb | 2 +- test/rubygems/test_remote_fetch_error.rb | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb index f8a2621..1278aa2 100644 --- a/lib/rubygems/test_case.rb +++ b/lib/rubygems/test_case.rb @@ -1558,12 +1558,12 @@ Also, a list: https://github.com/ruby/ruby/blob/trunk/lib/rubygems/test_case.rb#L1558 end class Object - def stub name, val_or_callable, *block_args + def stub(name, val_or_callable, *block_args) new_name = "__minitest_stub__#{name}" metaclass = class << self; self; end - if respond_to? name and not methods.map(&:to_s).include? name.to_s then + if respond_to? name and not methods.map(&:to_s).include? name.to_s metaclass.send :define_method, name do |*args| super(*args) end @@ -1572,7 +1572,7 @@ class Object https://github.com/ruby/ruby/blob/trunk/lib/rubygems/test_case.rb#L1572 metaclass.send :alias_method, new_name, name metaclass.send :define_method, name do |*args, &blk| - if val_or_callable.respond_to? :call then + if val_or_callable.respond_to? :call val_or_callable.call(*args, &blk) else blk.call(*block_args) if blk diff --git a/test/rubygems/test_gem_commands_help_command.rb b/test/rubygems/test_gem_commands_help_command.rb index b85c6fb..24cf2d2 100644 --- a/test/rubygems/test_gem_commands_help_command.rb +++ b/test/rubygems/test_gem_commands_help_command.rb @@ -48,7 +48,7 @@ class TestGemCommandsHelpCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_help_command.rb#L48 if Gem::HAVE_OPENSSL assert_empty err - refute_match %r|No command found for |, out + refute_match %r{No command found for }, out end end end diff --git a/test/rubygems/test_gem_package_tar_writer.rb b/test/rubygems/test_gem_package_tar_writer.rb index b1fe231..925f018 100644 --- a/test/rubygems/test_gem_package_tar_writer.rb +++ b/test/rubygems/test_gem_package_tar_writer.rb @@ -148,12 +148,12 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_package_tar_writer.rb#L148 end def test_add_file_simple - @tar_writer.add_file_simple 'x', 0644, 10 do |io| - io.write "a" * 10 - end + @tar_writer.add_file_simple 'x', 0644, 10 do |io| + io.write "a" * 10 + end - assert_headers_equal(tar_file_header('x', '', 0644, 10, Time.now), - @io.string[0, 512]) + assert_headers_equal(tar_file_header('x', '', 0644, 10, Time.now), + @io.string[0, 512]) assert_equal "aaaaaaaaaa#{"\0" * 502}", @io.string[512, 512] assert_equal 1024, @io.pos @@ -170,10 +170,10 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_package_tar_writer.rb#L170 end def test_add_file_simple_padding - @tar_writer.add_file_simple 'x', 0, 100 + @tar_writer.add_file_simple 'x', 0, 100 - assert_headers_equal tar_file_header('x', '', 0, 100, Time.now), - @io.string[0, 512] + assert_headers_equal tar_file_header('x', '', 0, 100, Time.now), + @io.string[0, 512] assert_equal "\0" * 512, @io.string[512, 512] end diff --git a/test/rubygems/test_gem_request_set.rb b/test/rubygems/test_gem_request_set.rb index d15f5ae..404e9b6 100644 --- a/test/rubygems/test_gem_request_set.rb +++ b/test/rubygems/test_gem_request_set.rb @@ -87,7 +87,7 @@ Gems to install: https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_request_set.rb#L87 a-2 EXPECTED - actual, _= capture_output do + actual, _ = capture_output do rs.install_from_gemdeps :gemdeps => io.path, :explain => true end assert_equal(expected, actual) diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index 7e82793..d014eae 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -2619,7 +2619,7 @@ end https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_specification.rb#L2619 def test_to_yaml yaml_str = @a1.to_yaml - refute_match %r|!!null|, yaml_str + refute_match %r{!!null}, yaml_str same_spec = Gem::Specification.from_yaml(yaml_str) diff --git a/test/rubygems/test_remote_fetch_error.rb b/test/rubygems/test_remote_fetch_error.rb index 6602f82..a1c25bc 100644 --- a/test/rubygems/test_remote_fetch_error.rb +++ b/test/rubygems/test_remote_fetch_error.rb @@ -4,7 +4,7 @@ require 'rubygems/test_case' https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_remote_fetch_error.rb#L4 class TestRemoteFetchError < Gem::TestCase def test_password_redacted error = Gem::RemoteFetcher::FetchError.new('There was an error fetching', 'https://user:secret@g...') - refute_match %r|secret|, error.to_s + refute_match %r{secret}, error.to_s end def test_invalid_url -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/