Dont't handle inline Gemfile

This commit is contained in:
Hiroshi SHIBATA 2023-10-12 13:24:55 +09:00
parent 75644f98e5
commit c2bdb198d7

View file

@ -247,12 +247,7 @@ module Bundler
file = File.path(file) file = File.path(file)
name = file.tr("/", "-") name = file.tr("/", "-")
if message = ::Gem::BUNDLED_GEMS.warning?(name) if message = ::Gem::BUNDLED_GEMS.warning?(name)
target_file = begin message += " Add #{name} to your Gemfile."
Bundler.default_gemfile.basename
rescue GemfileNotFound
"inline Gemfile"
end
message += " Add #{name} to your #{target_file}."
location = caller_locations(1,1)[0]&.path location = caller_locations(1,1)[0]&.path
if File.file?(location) && !location.start_with?(Gem::BUNDLED_GEMS::LIBDIR) if File.file?(location) && !location.start_with?(Gem::BUNDLED_GEMS::LIBDIR)
caller_gem = nil caller_gem = nil