method
lockfile_contents
v2_6_3 -
Show latest stable
- Class:
Gem::BundlerVersionFinder
lockfile_contents()private
No documentation available.
# File lib/rubygems/bundler_version_finder.rb, line 77
def self.lockfile_contents
gemfile = ENV["BUNDLE_GEMFILE"]
gemfile = nil if gemfile && gemfile.empty?
Gem::Util.traverse_parents Dir.pwd do |directory|
next unless gemfile = Gem::GEM_DEP_FILES.find { |f| File.file?(f.untaint) }
gemfile = File.join directory, gemfile
break
end unless gemfile
return unless gemfile
lockfile = case gemfile
when "gems.rb" then "gems.locked"
else "#{gemfile}.lock"
end.dup.untaint
return unless File.file?(lockfile)
[lockfile, File.read(lockfile)]
end