class method
Gem::BundlerVersionFinder.lockfile_contents
lockfile_contents
lib/rubygems/bundler_version_finder.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems/bundler_version_finder.rb, line 51
def self.lockfile_contents
gemfile = ENV["BUNDLE_GEMFILE"]
gemfile = nil if gemfile&.empty?
unless gemfile
begin
Gem::Util.traverse_parents(Dir.pwd) do |directory|
next unless gemfile = Gem::GEM_DEP_FILES.find {|f| File.file?(f) }
gemfile = File.join directory, gemfile
break
end
rescue Errno::ENOENT
return
end
end
return unless gemfile
lockfile = ENV["BUNDLE_LOCKFILE"]
lockfile = nil if lockfile&.empty?
lockfile ||= case gemfile
when "gems.rb" then "gems.locked"
else "#{gemfile}.lock"
end
return unless File.file?(lockfile)
File.read(lockfile)
end
No documentation available
See also
.bundle_update_bundler_version
.lockfile_version
.bundler_version
.prioritize!
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0