[rubygems/rubygems] Bump rubocop to 0.74.0 and fix new offenses

https://github.com/rubygems/rubygems/commit/d4fc383497
This commit is contained in:
David Rodríguez 2019-08-22 17:36:29 +02:00 committed by Hiroshi SHIBATA
parent 0b9b0774c3
commit d9e6315177
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2
12 changed files with 22 additions and 22 deletions

View File

@ -206,8 +206,8 @@ class Gem::BasicSpecification
def internal_init # :nodoc: def internal_init # :nodoc:
@extension_dir = nil @extension_dir = nil
@full_gem_path = nil @full_gem_path = nil
@gem_dir = nil @gem_dir = nil
@ignored = nil @ignored = nil
end end

View File

@ -140,7 +140,7 @@ class Gem::Dependency
if defined?(@version_requirement) && @version_requirement if defined?(@version_requirement) && @version_requirement
version = @version_requirement.instance_variable_get :@version version = @version_requirement.instance_variable_get :@version
@version_requirement = nil @version_requirement = nil
@version_requirements = Gem::Requirement.new version @version_requirements = Gem::Requirement.new version
end end
@ -266,7 +266,7 @@ class Gem::Dependency
end end
default = Gem::Requirement.default default = Gem::Requirement.default
self_req = self.requirement self_req = self.requirement
other_req = other.requirement other_req = other.requirement
return self.class.new name, self_req if other_req == default return self.class.new name, self_req if other_req == default

View File

@ -88,14 +88,14 @@ class Gem::DependencyInstaller
@wrappers = options[:wrappers] @wrappers = options[:wrappers]
@build_args = options[:build_args] @build_args = options[:build_args]
@build_docs_in_background = options[:build_docs_in_background] @build_docs_in_background = options[:build_docs_in_background]
@install_as_default = options[:install_as_default] @install_as_default = options[:install_as_default]
@dir_mode = options[:dir_mode] @dir_mode = options[:dir_mode]
@data_mode = options[:data_mode] @data_mode = options[:data_mode]
@prog_mode = options[:prog_mode] @prog_mode = options[:prog_mode]
# Indicates that we should not try to update any deps unless # Indicates that we should not try to update any deps unless
# we absolutely must. # we absolutely must.
@minimal_deps = options[:minimal_deps] @minimal_deps = options[:minimal_deps]
@available = nil @available = nil
@installed_gems = [] @installed_gems = []

View File

@ -108,7 +108,7 @@ class Gem::Ext::Builder
@build_args = build_args @build_args = build_args
@gem_dir = spec.full_gem_path @gem_dir = spec.full_gem_path
@ran_rake = false @ran_rake = false
end end
## ##

View File

@ -698,7 +698,7 @@ class Gem::Installer
@development = options[:development] @development = options[:development]
@build_root = options[:build_root] @build_root = options[:build_root]
@build_args = options[:build_args] || Gem::Command.build_args @build_args = options[:build_args] || Gem::Command.build_args
unless @build_root.nil? unless @build_root.nil?
require 'pathname' require 'pathname'

View File

@ -190,8 +190,8 @@ class Gem::Specification < Gem::BasicSpecification
# Sentinel object to represent "not found" stubs # Sentinel object to represent "not found" stubs
NOT_FOUND = Struct.new(:to_spec, :this).new # :nodoc: NOT_FOUND = Struct.new(:to_spec, :this).new # :nodoc:
@@spec_with_requirable_file = {} @@spec_with_requirable_file = {}
@@active_stub_with_requirable_file = {} @@active_stub_with_requirable_file = {}
###################################################################### ######################################################################
# :section: Required gemspec attributes # :section: Required gemspec attributes
@ -1230,8 +1230,8 @@ class Gem::Specification < Gem::BasicSpecification
@@all = nil @@all = nil
@@stubs = nil @@stubs = nil
@@stubs_by_name = {} @@stubs_by_name = {}
@@spec_with_requirable_file = {} @@spec_with_requirable_file = {}
@@active_stub_with_requirable_file = {} @@active_stub_with_requirable_file = {}
_clear_load_cache _clear_load_cache
unresolved = unresolved_deps unresolved = unresolved_deps
unless unresolved.empty? unless unresolved.empty?

View File

@ -392,7 +392,7 @@ class Gem::Version
def _split_segments def _split_segments
string_start = _segments.index {|s| s.is_a?(String) } string_start = _segments.index {|s| s.is_a?(String) }
string_segments = segments string_segments = segments
numeric_segments = string_segments.slice!(0, string_start || string_segments.size) numeric_segments = string_segments.slice!(0, string_start || string_segments.size)
return numeric_segments, string_segments return numeric_segments, string_segments
end end

View File

@ -670,7 +670,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = [a2.name] @cmd.options[:args] = [a2.name]
gemdir = File.join @gemhome, 'specifications' gemdir = File.join @gemhome, 'specifications'
a2_gemspec = File.join(gemdir, "a-2.gemspec") a2_gemspec = File.join(gemdir, "a-2.gemspec")
a1_gemspec = File.join(gemdir, "a-1.gemspec") a1_gemspec = File.join(gemdir, "a-1.gemspec")

View File

@ -222,7 +222,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
lib_bundler = File.join lib, 'bundler' lib_bundler = File.join lib, 'bundler'
lib_rubygems_defaults = File.join lib_rubygems, 'defaults' lib_rubygems_defaults = File.join lib_rubygems, 'defaults'
securerandom_rb = File.join lib, 'securerandom.rb' securerandom_rb = File.join lib, 'securerandom.rb'
engine_defaults_rb = File.join lib_rubygems_defaults, 'jruby.rb' engine_defaults_rb = File.join lib_rubygems_defaults, 'jruby.rb'
os_defaults_rb = File.join lib_rubygems_defaults, 'operating_system.rb' os_defaults_rb = File.join lib_rubygems_defaults, 'operating_system.rb'

View File

@ -87,7 +87,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase
fetcher.data[data_key] = response fetcher.data[data_key] = response
Gem::RemoteFetcher.fetcher = fetcher Gem::RemoteFetcher.fetcher = fetcher
sign_in_ui = ui_stub || Gem::MockGemUi.new("#{email}\n#{password}\n") sign_in_ui = ui_stub || Gem::MockGemUi.new("#{email}\n#{password}\n")
use_ui sign_in_ui do use_ui sign_in_ui do
yield yield

View File

@ -32,7 +32,7 @@ class TestGemDependencyInstaller < Gem::TestCase
@a1_pre, @a1_pre_gem = util_gem 'a', '1.a' @a1_pre, @a1_pre_gem = util_gem 'a', '1.a'
@b1, @b1_gem = util_gem 'b', '1' do |s| @b1, @b1_gem = util_gem 'b', '1' do |s|
s.add_dependency 'a' s.add_dependency 'a'
s.add_development_dependency 'aa' s.add_development_dependency 'aa'
end end

View File

@ -740,7 +740,7 @@ class TestGemResolver < Gem::TestCase
def test_select_local_platforms def test_select_local_platforms
r = Gem::Resolver.new nil, nil r = Gem::Resolver.new nil, nil
a1 = util_spec 'a', 1 a1 = util_spec 'a', 1
a1_p1 = util_spec 'a', 1 do |s| a1_p1 = util_spec 'a', 1 do |s|
s.platform = Gem::Platform.local s.platform = Gem::Platform.local
@ -756,7 +756,7 @@ class TestGemResolver < Gem::TestCase
end end
def test_search_for_local_platform_partial_string_match def test_search_for_local_platform_partial_string_match
a1 = util_spec 'a', 1 a1 = util_spec 'a', 1
a1_p1 = util_spec 'a', 1 do |s| a1_p1 = util_spec 'a', 1 do |s|
s.platform = Gem::Platform.local.os s.platform = Gem::Platform.local.os