aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/source
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2022-12-12 09:09:23 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-12-12 10:49:43 +0900
commitbbe56a643734025aef6a3cbeb07c5306505040f6 (patch)
treec6980a39ce6571c032695702bd974431eee4d516 /lib/bundler/source
parentf1cdc129d4d6440168b840fa852fa6c3e28d46a9 (diff)
downloadruby-bbe56a643734025aef6a3cbeb07c5306505040f6.tar.gz
Merge RubyGems/Bundler master
from https://github.com/rubygems/rubygems/commit/bfb0ae69776069155d2092702bfbb5a12617d85a
Diffstat (limited to 'lib/bundler/source')
-rw-r--r--lib/bundler/source/git.rb4
-rw-r--r--lib/bundler/source/git/git_proxy.rb2
-rw-r--r--lib/bundler/source/path.rb10
-rw-r--r--lib/bundler/source/rubygems.rb8
4 files changed, 11 insertions, 13 deletions
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb
index 745ae05c5c..dc89dedeb2 100644
--- a/lib/bundler/source/git.rb
+++ b/lib/bundler/source/git.rb
@@ -64,7 +64,7 @@ module Bundler
at = if local?
path
elsif user_ref = options["ref"]
- if ref =~ /\A[a-z0-9]{4,}\z/i
+ if /\A[a-z0-9]{4,}\z/i.match?(ref)
shortref_for_display(user_ref)
else
user_ref
@@ -295,7 +295,7 @@ module Bundler
end
def uri_hash
- if uri =~ %r{^\w+://(\w+@)?}
+ if %r{^\w+://(\w+@)?}.match?(uri)
# Downcase the domain component of the URI
# and strip off a trailing slash, if one is present
input = Bundler::URI.parse(uri).normalize.to_s.sub(%r{/$}, "")
diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb
index 5468536f86..e379c84741 100644
--- a/lib/bundler/source/git/git_proxy.rb
+++ b/lib/bundler/source/git/git_proxy.rb
@@ -250,7 +250,7 @@ module Bundler
# Adds credentials to the URI
def configured_uri
- if /https?:/ =~ uri
+ if /https?:/.match?(uri)
remote = Bundler::URI(uri)
config_auth = Bundler.settings[remote.to_s] || Bundler.settings[remote.host]
remote.userinfo ||= config_auth
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb
index 672ecfd13b..20975e20ca 100644
--- a/lib/bundler/source/path.rb
+++ b/lib/bundler/source/path.rb
@@ -224,13 +224,13 @@ module Bundler
# Some gem authors put absolute paths in their gemspec
# and we have to save them from themselves
- spec.files = spec.files.map do |p|
- next p unless p =~ /\A#{Pathname::SEPARATOR_PAT}/
- next if File.directory?(p)
+ spec.files = spec.files.map do |path|
+ next path unless /\A#{Pathname::SEPARATOR_PAT}/.match?(path)
+ next if File.directory?(path)
begin
- Pathname.new(p).relative_path_from(gem_dir).to_s
+ Pathname.new(path).relative_path_from(gem_dir).to_s
rescue ArgumentError
- p
+ path
end
end.compact
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 3b640b55a9..7eefd291a2 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -145,7 +145,7 @@ module Bundler
end
if installed?(spec) && !force
- print_using_message "Using #{version_message(spec)}"
+ print_using_message "Using #{version_message(spec, options[:previous_spec])}"
return nil # no post-install message
end
@@ -163,8 +163,6 @@ module Bundler
install_path = rubygems_dir
bin_path = Bundler.system_bindir
- Bundler.mkdir_p bin_path unless spec.executables.empty? || Bundler.rubygems.provides?(">= 2.7.5")
-
require_relative "../rubygems_gem_installer"
installer = Bundler::RubyGemsGemInstaller.at(
@@ -340,7 +338,7 @@ module Bundler
def normalize_uri(uri)
uri = uri.to_s
- uri = "#{uri}/" unless uri =~ %r{/$}
+ uri = "#{uri}/" unless %r{/$}.match?(uri)
require_relative "../vendored_uri"
uri = Bundler::URI(uri)
raise ArgumentError, "The source must be an absolute URI. For example:\n" \
@@ -383,7 +381,7 @@ module Bundler
idx = @allow_local ? installed_specs.dup : Index.new
Dir["#{cache_path}/*.gem"].each do |gemfile|
- next if gemfile =~ /^bundler\-[\d\.]+?\.gem/
+ next if /^bundler\-[\d\.]+?\.gem/.match?(gemfile)
s ||= Bundler.rubygems.spec_from_gem(gemfile)
s.source = self
idx << s