diff options
| author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-07-20 11:05:53 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2023-07-25 06:23:25 +0000 |
| commit | ec600332fcf60a0d54cf5de1051d189270931ee3 (patch) | |
| tree | 7f53f07a30769e5deca47bceddffdfa3d5c708ba | |
| parent | 2424b921b2e773343fa7dd670c40e26873adc22f (diff) | |
[rubygems/rubygems] Simplefied condition
https://github.com/rubygems/rubygems/commit/5238fcf234
| -rw-r--r-- | lib/bundler/rubygems_integration.rb | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index 4c207cabc3..9e222f90b1 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -233,16 +233,14 @@ module Bundler [kernel, ::Kernel].each do |kernel_class| kernel_class.send(:alias_method, :no_warning_require, :require) kernel_class.send(:define_method, :require) do |file| - if ::Gem::BUNDLED_GEMS.include?(file) - unless specs.to_a.map(&:name).include?(file) - target_file = begin - Bundler.default_gemfile.basename - rescue GemfileNotFound - "inline Gemfile" - end - warn "#{file} is not part of the bundle." \ - " Add it to your #{target_file}." - end + if (::Gem::BUNDLED_GEMS - specs.to_a.map(&:name)).include?(file) + target_file = begin + Bundler.default_gemfile.basename + rescue GemfileNotFound + "inline Gemfile" + end + warn "#{file} is not part of the bundle." \ + " Add it to your #{target_file}." end kernel_class.send(:no_warning_require, file) end |
