Skip to content

Commit

Permalink
Merge pull request #7371 from rubygems/update-deps
Browse files Browse the repository at this point in the history
Update dependencies and correct rubocop failure

(cherry picked from commit 8c6b6bc)
  • Loading branch information
hsbt authored and deivid-rodriguez committed Mar 20, 2024
1 parent 7ac045d commit 12fd3a0
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 30 deletions.
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 @@ -1225,7 +1225,7 @@ def find_default_spec(path)

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"
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
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 = Gem::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
19 changes: 11 additions & 8 deletions tool/bundler/lint_gems.rb.lock
Expand Up @@ -4,6 +4,7 @@ GEM
ast (2.4.2)
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)
Expand All @@ -13,21 +14,22 @@ GEM
rainbow (3.1.1)
regexp_parser (2.9.0)
rexml (3.2.6)
rubocop (1.52.1)
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.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.5.0)

Expand All @@ -48,16 +50,17 @@ CHECKSUMS
ast (2.4.2) sha256=1e280232e6a33754cde542bc5ef85520b74db2aac73ec14acef453784447cc12
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.9.0) sha256=81a00ba141cec0d4b4bf58cb80cd9193e5180836d3fa6ef623f7886d3ba8bdd9
rexml (3.2.6) sha256=e0669a2d4e9f109951cb1fde723d8acd285425d81594a2ea929304af50282816
rubocop (1.52.1) sha256=908718035c4771f414280412be0d9168a7abd310da1ab859a50d41bece0dac2f
rubocop (1.59.0) sha256=09cf4b874ce87f777e8dc711b0f5e2ef4b123eb20d7e38ae2b85c43015a0fc43
rubocop-ast (1.30.0) sha256=faad6452b1018fee0dd9e21a44445908e94ee2a4435932a9dae0e0740b6349b3
rubocop-performance (1.14.2) sha256=551afc2df245c3d745d69296707e0b0192ea2b593574f7b264404be30f86ccb4
rubocop-performance (1.20.2) sha256=1bb1fa8c427fac7ba3c8dd2decb9860f23cb2d6c40350bedc88538de8875c731
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
unicode-display_width (2.5.0) sha256=7e7681dcade1add70cb9fda20dd77f300b8587c81ebbd165d14fd93144ff0ab4

Expand Down

0 comments on commit 12fd3a0

Please sign in to comment.