From f16c50772c97c9cbc2f9f1eb0087224a92c3c99b Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 28 Aug 2023 14:58:33 +0900 Subject: [PATCH] [rubygems/rubygems] rubocop -a https://github.com/rubygems/rubygems/commit/f240bfad2a --- lib/bundler/rubygems_integration.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index 060be66c8c3e15..d6f179cc96f6dc 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -253,21 +253,21 @@ def replace_require(specs) rescue GemfileNotFound "inline Gemfile" end - be = RUBY_VERSION < ::Gem::BUNDLED_GEMS::SINCE[name] ? "will be" : "is" + be = ::Gem::BUNDLED_GEMS::SINCE[name] > RUBY_VERSION ? "will be" : "is" message = "#{name} #{be} not part of the default gems since Ruby #{::Gem::BUNDLED_GEMS::SINCE[name]}." \ " Add #{name} to your #{target_file}." location = caller_locations(1,1)[0]&.path if File.file?(location) && !location.start_with?(Gem::BUNDLED_GEMS::LIBDIR) caller_gem = nil Gem.path.each do |path| - if location =~ /#{path}\/gems\/([\w\-\.]+)/ + if location =~ %r{#{path}/gems/([\w\-\.]+)} caller_gem = $1 break end end message += " Also contact author of #{caller_gem} to add #{name} into its gemspec." end - warn message, uplevel: 1 + warn message, :uplevel => 1 end end kernel_class.send(:no_warning_require, file)