Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies and correct rubocop failure #7371

Merged
merged 10 commits into from Jan 11, 2024
2 changes: 1 addition & 1 deletion bundler/lib/bundler/cli.rb
Expand Up @@ -620,7 +620,7 @@ def inject(name, version)
method_option "major", type: :boolean, banner: "If updating, prefer updating to next major version (default)"
method_option "pre", type: :boolean, banner: "If updating, always choose the highest allowed version, regardless of prerelease status"
method_option "strict", type: :boolean, banner: "If updating, do not allow any gem to be updated past latest --patch | --minor | --major"
method_option "conservative", type: :boolean, banner: "If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated"
method_option "conservative", type: :boolean, banner: "If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated"
method_option "bundler", type: :string, lazy_default: "> 0.a", banner: "Update the locked version of bundler"
def lock
require_relative "cli/lock"
Expand Down
2 changes: 1 addition & 1 deletion bundler/lib/bundler/cli/binstubs.rb
Expand Up @@ -45,7 +45,7 @@ def run
next
end

Bundler.settings.temporary(path: (Bundler.settings[:path] || Bundler.root)) do
Bundler.settings.temporary(path: Bundler.settings[:path] || Bundler.root) do
installer.generate_standalone_bundler_executable_stubs(spec, installer_opts)
end
else
Expand Down
2 changes: 1 addition & 1 deletion bundler/lib/bundler/rubygems_ext.rb
Expand Up @@ -282,7 +282,7 @@ def match_platforms?(platform, platforms)

# On universal Rubies, resolve the "universal" arch to the real CPU arch, without changing the extension directory.
class BasicSpecification
if /^universal\.(?<arch>.*?)-/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
if /^universal\.(?<arch>.*?)-/ =~ (CROSS_COMPILING || RUBY_PLATFORM) # rubocop:disable Style/RedundantParentheses
local_platform = Platform.local
if local_platform.cpu == "universal"
ORIGINAL_LOCAL_PLATFORM = local_platform.to_s.freeze
Expand Down
2 changes: 1 addition & 1 deletion lib/rubygems.rb
Expand Up @@ -1218,7 +1218,7 @@ def register_default_spec(spec)

def find_unresolved_default_spec(path)
default_spec = @path_to_default_spec_map[path]
return default_spec if default_spec && loaded_specs[default_spec.name] != default_spec
default_spec if default_spec && loaded_specs[default_spec.name] != default_spec
end

##
Expand Down
2 changes: 1 addition & 1 deletion lib/rubygems/commands/rdoc_command.rb
Expand Up @@ -87,7 +87,7 @@ def execute
begin
doc.generate
rescue Errno::ENOENT => e
match = / - /.match(e.message)
match = e.message.include?(" - ")
alert_error "Unable to document #{spec.full_name}, " \
" #{match.post_match} is missing, skipping"
deivid-rodriguez marked this conversation as resolved.
Show resolved Hide resolved
terminate_interaction 1 if specs.length == 1
Expand Down
8 changes: 4 additions & 4 deletions lib/rubygems/defaults.rb
Expand Up @@ -112,7 +112,7 @@ def self.user_dir
# The path to standard location of the user's configuration directory.

def self.config_home
@config_home ||= (ENV["XDG_CONFIG_HOME"] || File.join(Gem.user_home, ".config"))
@config_home ||= ENV["XDG_CONFIG_HOME"] || File.join(Gem.user_home, ".config")
end

##
Expand Down Expand Up @@ -145,21 +145,21 @@ def self.state_file
# The path to standard location of the user's cache directory.

def self.cache_home
@cache_home ||= (ENV["XDG_CACHE_HOME"] || File.join(Gem.user_home, ".cache"))
@cache_home ||= ENV["XDG_CACHE_HOME"] || File.join(Gem.user_home, ".cache")
end

##
# The path to standard location of the user's data directory.

def self.data_home
@data_home ||= (ENV["XDG_DATA_HOME"] || File.join(Gem.user_home, ".local", "share"))
@data_home ||= ENV["XDG_DATA_HOME"] || File.join(Gem.user_home, ".local", "share")
end

##
# The path to standard location of the user's state directory.

def self.state_home
@state_home ||= (ENV["XDG_STATE_HOME"] || File.join(Gem.user_home, ".local", "state"))
@state_home ||= ENV["XDG_STATE_HOME"] || File.join(Gem.user_home, ".local", "state")
end

##
Expand Down
2 changes: 1 addition & 1 deletion lib/rubygems/specification_policy.rb
Expand Up @@ -7,7 +7,7 @@ class Gem::SpecificationPolicy

VALID_NAME_PATTERN = /\A[a-zA-Z0-9\.\-\_]+\z/ # :nodoc:

SPECIAL_CHARACTERS = /\A[#{Regexp.escape('.-_')}]+/ # :nodoc:
SPECIAL_CHARACTERS = /\A[#{Regexp.escape(".-_")}]+/ # :nodoc:

VALID_URI_PATTERN = %r{\Ahttps?:\/\/([^\s:@]+:[^\s:@]*@)?[A-Za-z\d\-]+(\.[A-Za-z\d\-]+)+\.?(:\d{1,5})?([\/?]\S*)?\z} # :nodoc:

Expand Down
2 changes: 1 addition & 1 deletion test/rubygems/test_gem_commands_environment_command.rb
Expand Up @@ -30,7 +30,7 @@ def test_execute
assert_match(/USER INSTALLATION DIRECTORY: #{Regexp.escape Gem.user_dir}/,
@ui.output)
assert_match(/RUBYGEMS PREFIX: /, @ui.output)
assert_match(/RUBY EXECUTABLE:.*#{RbConfig::CONFIG['ruby_install_name']}/,
assert_match(/RUBY EXECUTABLE:.*#{RbConfig::CONFIG["ruby_install_name"]}/,
@ui.output)
assert_match(/GIT EXECUTABLE: #{@cmd.send(:git_path)}/, @ui.output)
assert_match(/SYSTEM CONFIGURATION DIRECTORY:/, @ui.output)
Expand Down
6 changes: 3 additions & 3 deletions test/rubygems/test_gem_dependency_installer.rb
Expand Up @@ -198,7 +198,7 @@ def test_install_dependencies_satisfied
Gem::Specification.reset

FileUtils.mv @a1_gem, @tempdir
FileUtils.mv a2_gem, @tempdir # not in index
FileUtils.mv a2_gem, @tempdir # not in index
FileUtils.mv @b1_gem, @tempdir
inst = nil

Expand Down Expand Up @@ -237,7 +237,7 @@ def test_install_doesnt_upgrade_installed_dependencies
Gem::Specification.reset

FileUtils.mv @a1_gem, @tempdir
FileUtils.mv a2_gem, @tempdir # not in index
FileUtils.mv a2_gem, @tempdir # not in index
FileUtils.mv @b1_gem, @tempdir
FileUtils.mv a3_gem, @tempdir

Expand Down Expand Up @@ -621,7 +621,7 @@ def test_install_env_shebang

env = "/\\S+/env" unless Gem.win_platform?

assert_match(/\A#!#{env} #{RbConfig::CONFIG['ruby_install_name']}\n/,
assert_match(/\A#!#{env} #{RbConfig::CONFIG["ruby_install_name"]}\n/,
File.read(File.join(@gemhome, "bin", "a_bin")))
end

Expand Down
14 changes: 7 additions & 7 deletions test/rubygems/test_gem_ext_builder.rb
Expand Up @@ -48,11 +48,11 @@ def test_class_make

results = results.join("\n").b

assert_match(/DESTDIR\\=#{ENV['DESTDIR']} clean$/, results)
assert_match(/DESTDIR\\=#{ENV['DESTDIR']}$/, results)
assert_match(/DESTDIR\\=#{ENV['DESTDIR']} install$/, results)
assert_match(/DESTDIR\\=#{ENV["DESTDIR"]} clean$/, results)
assert_match(/DESTDIR\\=#{ENV["DESTDIR"]}$/, results)
assert_match(/DESTDIR\\=#{ENV["DESTDIR"]} install$/, results)

unless /nmake/.match?(results)
unless results.include?("nmake")
assert_match(/^clean: destination$/, results)
assert_match(/^all: destination$/, results)
assert_match(/^install: destination$/, results)
Expand All @@ -77,9 +77,9 @@ def test_class_make_no_clean

results = results.join("\n").b

assert_match(/DESTDIR\\=#{ENV['DESTDIR']} clean$/, results)
assert_match(/DESTDIR\\=#{ENV['DESTDIR']}$/, results)
assert_match(/DESTDIR\\=#{ENV['DESTDIR']} install$/, results)
assert_match(/DESTDIR\\=#{ENV["DESTDIR"]} clean$/, results)
assert_match(/DESTDIR\\=#{ENV["DESTDIR"]}$/, results)
assert_match(/DESTDIR\\=#{ENV["DESTDIR"]} install$/, results)
end

def test_custom_make_with_options
Expand Down
4 changes: 2 additions & 2 deletions test/rubygems/test_gem_safe_marshal.rb
Expand Up @@ -120,7 +120,7 @@ class TestGemSafeMarshal < Gem::TestCase
define_method("test_safe_load_marshal Time 2001-01-01 07:59:59 UTC") { assert_safe_load_marshal "\x04\bIu:\tTime\r'@\x19\xC0\x00\x00\xB0\xEF\x06:\tzoneI\"\bUTC\x06:\x06EF", additional_methods: [:ctime, :to_f, :to_r, :to_i, :zone, :subsec, :instance_variables, :dst?, :to_a] }
define_method("test_safe_load_marshal Time 2001-01-01 11:59:59 +0400") { assert_safe_load_marshal "\x04\bIu:\tTime\r'@\x19\x80\x00\x00\xB0\xEF\a:\voffseti\x02@8:\tzone0", additional_methods: [:ctime, :to_f, :to_r, :to_i, :zone, :subsec, :instance_variables, :dst?, :to_a] }
define_method("test_safe_load_marshal Time 2023-08-24 10:10:39.09565 -0700") { assert_safe_load_marshal "\x04\bIu:\tTime\r\x11\xDF\x1E\x80\xA2uq*\a:\voffseti\xFE\x90\x9D:\tzoneI\"\bPDT\x06:\x06EF" }
define_method("test_safe_load_marshal Time 2023-08-24 10:10:39.098453 -0700") { assert_safe_load_marshal "\x04\bIu:\tTime\r\x11\xDF\x1E\x80\x95\x80q*\b:\n@typeI\"\fruntime\x06:\x06ET:\voffseti\xFE\x90\x9D:\tzoneI\"\bPDT\x06;\aF", permitted_ivars: { "Time" => %w[@type offset zone], "String" => %w[E @debug_created_info] }, marshal_dump_equality: (RUBY_ENGINE != "truffleruby" || RUBY_ENGINE_VERSION >= "23") }
define_method("test_safe_load_marshal Time 2023-08-24 10:10:39.098453 -0700") { assert_safe_load_marshal "\x04\bIu:\tTime\r\x11\xDF\x1E\x80\x95\x80q*\b:\n@typeI\"\fruntime\x06:\x06ET:\voffseti\xFE\x90\x9D:\tzoneI\"\bPDT\x06;\aF", permitted_ivars: { "Time" => %w[@type offset zone], "String" => %w[E @debug_created_info] }, marshal_dump_equality: RUBY_ENGINE != "truffleruby" || RUBY_ENGINE_VERSION >= "23" }

def test_repeated_symbol
assert_safe_load_as [:development, :development]
Expand Down Expand Up @@ -188,7 +188,7 @@ def test_time_with_ivar
pend "Marshal.load of Time with ivars is broken on jruby, see https://github.com/jruby/jruby/issues/7902" if RUBY_ENGINE == "jruby"

with_const(Gem::SafeMarshal, :PERMITTED_IVARS, { "Time" => %w[@type offset zone nano_num nano_den submicro], "String" => %w[E @debug_created_info] }) do
assert_safe_load_as Time.new.tap {|t| t.instance_variable_set :@type, "runtime" }, marshal_dump_equality: (RUBY_ENGINE != "truffleruby" || RUBY_ENGINE_VERSION >= "23")
assert_safe_load_as Time.new.tap {|t| t.instance_variable_set :@type, "runtime" }, marshal_dump_equality: RUBY_ENGINE != "truffleruby" || RUBY_ENGINE_VERSION >= "23"
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/rubygems/test_gem_source.rb
Expand Up @@ -39,7 +39,7 @@ def test_cache_dir_escapes_windows_paths
uri = URI.parse("file:///C:/WINDOWS/Temp/gem_repo")
root = Gem.spec_cache_dir
cache_dir = @source.cache_dir(uri).gsub(root, "")
assert cache_dir !~ /:/, "#{cache_dir} should not contain a :"
assert !cache_dir.include?(":"), "#{cache_dir} should not contain a :"
end

def test_dependency_resolver_set_bundler_api
Expand Down
28 changes: 20 additions & 8 deletions tool/bundler/dev_gems.rb.lock
Expand Up @@ -8,24 +8,32 @@ GEM
kramdown (~> 2.0)
mini_portile2 (2.8.5)
mustache (1.1.1)
nokogiri (1.15.5)
nokogiri (1.16.0)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.15.5-java)
nokogiri (1.16.0-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.0-java)
racc (~> 1.4)
nokogiri (1.16.0-x64-mingw-ucrt)
racc (~> 1.4)
nokogiri (1.16.0-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.0-x86_64-linux)
racc (~> 1.4)
nronn (0.11.1)
kramdown (~> 2.1)
kramdown-parser-gfm (>= 1.0.1, < 1.2)
mustache (~> 1.0)
nokogiri (~> 1.10, >= 1.10.10)
parallel (1.23.0)
parallel (1.24.0)
parallel_tests (3.8.1)
parallel
power_assert (2.0.3)
racc (1.7.3)
racc (1.7.3-java)
rake (13.1.0)
rb_sys (0.9.83)
rb_sys (0.9.86)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
Expand Down Expand Up @@ -82,16 +90,20 @@ CHECKSUMS
kramdown-parser-gfm (1.1.0) sha256=fb39745516427d2988543bf01fc4cf0ab1149476382393e0e9c48592f6581729
mini_portile2 (2.8.5) sha256=7a37db8ae758086c3c3ac3a59c036704d331e965d5e106635e4a42d6e66089ce
mustache (1.1.1) sha256=90891fdd50b53919ca334c8c1031eada1215e78d226d5795e523d6123a2717d0
nokogiri (1.15.5) sha256=22448ca35dbcbdcec60dbe25ccf452b685a5436c28f21b2fec2e20917aba9100
nokogiri (1.15.5-java) sha256=5f87e71aaeb4f7479b94698737a0aacea77836b4805c7433b655e9565bd56cfe
nokogiri (1.16.0) sha256=341388184e975d091e6e38ce3f3b3388bfb7e4ac3d790efd8e39124844040bd1
nokogiri (1.16.0-arm64-darwin) sha256=10c08f246085709790ea628b5fa031cf23dadd843e173711b335ba6287b59d0a
nokogiri (1.16.0-java) sha256=f76f2dc353993862d07eccfc5561e373e8058d62e265bae9bcf4f4793c35c9e2
nokogiri (1.16.0-x64-mingw-ucrt) sha256=5c59792f7f5f8a76e17a87b89b9057544853a6f713b692a75b7f8895a854b74f
nokogiri (1.16.0-x86_64-darwin) sha256=237aa89b9ef6b8e014f197167677926ebc4bdb9cafb2b101399d8001fda4fa43
nokogiri (1.16.0-x86_64-linux) sha256=6f55093bb47e75d412138f4b9462f960d3aad96cb6b43dbe9a3de62c2d31a742
nronn (0.11.1) sha256=60305c7a42dcaf6bdd33210993a7e38087520717561da101bea1df7197546369
parallel (1.23.0) sha256=27154713ad6ef32fa3dcb7788a721d6c07bca77e72443b4c6080a14145288c49
parallel (1.24.0) sha256=5bf38efb9b37865f8e93d7a762727f8c5fc5deb19949f4040c76481d5eee9397
parallel_tests (3.8.1) sha256=c781c0910be3b489411f24e3a3397d57f481d6ee4eb27dba2a1cd4b8a0967f06
power_assert (2.0.3) sha256=cd5e13c267370427c9804ce6a57925d6030613e341cb48e02eec1f3c772d4cf8
racc (1.7.3) sha256=b785ab8a30ec43bce073c51dbbe791fd27000f68d1c996c95da98bf685316905
racc (1.7.3-java) sha256=b2ad737e788cfa083263ce7c9290644bb0f2c691908249eb4f6eb48ed2815dbf
rake (13.1.0) sha256=be6a3e1aa7f66e6c65fa57555234eb75ce4cf4ada077658449207205474199c6
rb_sys (0.9.83) sha256=0ed80df79aa08b942af731d93a676f2d885428267f2fbf138f9b6b7809c6455e
rb_sys (0.9.86) sha256=65d35ad5f2f2e7257607310186d6a178f34d0fee807d3b1af5611db6a5503a8c
rexml (3.2.6) sha256=e0669a2d4e9f109951cb1fde723d8acd285425d81594a2ea929304af50282816
rspec (3.12.0) sha256=ccc41799a43509dc0be84070e3f0410ac95cbd480ae7b6c245543eb64162399c
rspec-core (3.12.2) sha256=155b54480f28e2b2813185077fe435c2d663031616360ed3b179a9d6a55d2551
Expand Down
59 changes: 31 additions & 28 deletions tool/bundler/lint_gems.rb.lock
Expand Up @@ -2,34 +2,36 @@ GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
json (2.6.3)
json (2.6.3-java)
parallel (1.23.0)
parser (3.2.2.3)
json (2.7.1)
json (2.7.1-java)
language_server-protocol (3.17.0.3)
parallel (1.24.0)
parser (3.3.0.2)
ast (~> 2.4.1)
racc
racc (1.7.1)
racc (1.7.1-java)
racc (1.7.3)
racc (1.7.3-java)
rainbow (3.1.1)
regexp_parser (2.8.1)
rexml (3.2.5)
rubocop (1.52.1)
regexp_parser (2.9.0)
rexml (3.2.6)
rubocop (1.59.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.3)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.0, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-performance (1.14.2)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-performance (1.20.2)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (1.13.0)
unicode-display_width (2.4.2)
unicode-display_width (2.5.0)

PLATFORMS
java
Expand All @@ -46,20 +48,21 @@ DEPENDENCIES

CHECKSUMS
ast (2.4.2) sha256=1e280232e6a33754cde542bc5ef85520b74db2aac73ec14acef453784447cc12
json (2.6.3) sha256=86aaea16adf346a2b22743d88f8dcceeb1038843989ab93cda44b5176c845459
json (2.6.3-java) sha256=ea8c47427a2c876121b9a0ab53043ca390013a76374330eabd923bd81914e563
parallel (1.23.0) sha256=27154713ad6ef32fa3dcb7788a721d6c07bca77e72443b4c6080a14145288c49
parser (3.2.2.3) sha256=10685f358ab36ffea2252dc4952e5b8fad3a297a8152a85f59adc982747b91eb
racc (1.7.1) sha256=af64124836fdd3c00e830703d7f873ea5deabde923f37006a39f5a5e0da16387
racc (1.7.1-java) sha256=eaa5cd10ace36a5c5a139e699875a45fa1dfd7d5df8432ffd6243962c6b24ef0
json (2.7.1) sha256=187ea312fb58420ff0c40f40af1862651d4295c8675267c6a1c353f1a0ac3265
json (2.7.1-java) sha256=bfd628c0f8357058c2cf848febfa6f140f70f94ec492693a31a0a1933038a61b
language_server-protocol (3.17.0.3) sha256=3d5c58c02f44a20d972957a9febe386d7e7468ab3900ce6bd2b563dd910c6b3f
parallel (1.24.0) sha256=5bf38efb9b37865f8e93d7a762727f8c5fc5deb19949f4040c76481d5eee9397
parser (3.3.0.2) sha256=418c5d5b56143c541693b9a00968b7005f94440e94e0b2945b55dc543e562ea0
racc (1.7.3) sha256=b785ab8a30ec43bce073c51dbbe791fd27000f68d1c996c95da98bf685316905
racc (1.7.3-java) sha256=b2ad737e788cfa083263ce7c9290644bb0f2c691908249eb4f6eb48ed2815dbf
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
regexp_parser (2.8.1) sha256=83f63e2bfae3db38f988c66f114485140ff1791321fd827480bc75aa42cacb8c
rexml (3.2.5) sha256=a33c3bf95fda7983ec7f05054f3a985af41dbc25a0339843bd2479e93cabb123
rubocop (1.52.1) sha256=908718035c4771f414280412be0d9168a7abd310da1ab859a50d41bece0dac2f
rubocop-ast (1.29.0) sha256=d1da2ab279a074baefc81758ac430c5768a8da8c7438dd4e5819ce5984d00ba1
rubocop-performance (1.14.2) sha256=551afc2df245c3d745d69296707e0b0192ea2b593574f7b264404be30f86ccb4
regexp_parser (2.9.0) sha256=81a00ba141cec0d4b4bf58cb80cd9193e5180836d3fa6ef623f7886d3ba8bdd9
rexml (3.2.6) sha256=e0669a2d4e9f109951cb1fde723d8acd285425d81594a2ea929304af50282816
rubocop (1.59.0) sha256=09cf4b874ce87f777e8dc711b0f5e2ef4b123eb20d7e38ae2b85c43015a0fc43
rubocop-ast (1.30.0) sha256=faad6452b1018fee0dd9e21a44445908e94ee2a4435932a9dae0e0740b6349b3
rubocop-performance (1.20.2) sha256=1bb1fa8c427fac7ba3c8dd2decb9860f23cb2d6c40350bedc88538de8875c731
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
unicode-display_width (2.4.2) sha256=6a10205d1a19ca790c4e53064ba93f09d9eb234bf6bd135d9deb6001c21428be
unicode-display_width (2.5.0) sha256=7e7681dcade1add70cb9fda20dd77f300b8587c81ebbd165d14fd93144ff0ab4

BUNDLED WITH
2.6.0.dev