diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-07-27 15:17:48 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-07-28 14:57:10 +0900 |
commit | 35517baae5a1bb5fa77771f7d465d0bf40c96a5d (patch) | |
tree | c7e3ea8e7359e39dee356b3049839c3d2d99ffa8 /lib/bundler/rubygems_integration.rb | |
parent | 989f3add62f45d6bf0250810c3c14e2bf22ddb78 (diff) | |
download | ruby-35517baae5a1bb5fa77771f7d465d0bf40c96a5d.tar.gz |
Use Gem::BUNDLED_GEMS::SINCE
Diffstat (limited to 'lib/bundler/rubygems_integration.rb')
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index e2d805d0ed..af749f8d10 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -1,10 +1,6 @@ # frozen_string_literal: true require "rubygems" unless defined?(Gem) -begin - require "bundled_gems" unless defined?(Gem::BUNDLED_GEMS) -rescue LoadError -end module Bundler class RubygemsIntegration @@ -250,14 +246,14 @@ module Bundler kernel_class.send(:alias_method, :no_warning_require, :require) kernel_class.send(:define_method, :require) do |file| name = file.to_s.tr("/", "-") - if (::Gem::BUNDLED_GEMS.keys - specs.to_a.map(&:name)).include?(name) + if (::Gem::BUNDLED_GEMS::SINCE.keys - specs.to_a.map(&:name)).include?(name) unless $LOADED_FEATURES.any? {|f| f.end_with?("#{name}.rb", "#{name}.#{RbConfig::CONFIG["DLEXT"]}") } target_file = begin Bundler.default_gemfile.basename rescue GemfileNotFound "inline Gemfile" end - warn "#{name} is not part of the default gems since Ruby #{::Gem::BUNDLED_GEMS[file]}." \ + warn "#{name} is not part of the default gems since Ruby #{::Gem::BUNDLED_GEMS::SINCE[file]}." \ " Add it to your #{target_file}." end end @@ -388,7 +384,7 @@ module Bundler def replace_entrypoints(specs) specs_by_name = add_default_gems_to(specs) - if defined?(::Gem::BUNDLED_GEMS) + if defined?(::Gem::BUNDLED_GEMS::SINCE) replace_require(specs) else reverse_rubygems_kernel_mixin |