aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/lockfile_generator.rb
diff options
context:
space:
mode:
authorMartin Emde <martinemde@users.noreply.github.com>2023-08-30 15:15:52 -0700
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-10-23 13:59:01 +0900
commit92f23a48e3bb7555ca99fc49e15b250a70f9d086 (patch)
treebd583abe4555696c8b68d141f7f51d8755b2e96e /lib/bundler/lockfile_generator.rb
parentc5fd94073ff2e22b6eea29c242c7e4a12ed7c865 (diff)
downloadruby-92f23a48e3bb7555ca99fc49e15b250a70f9d086.tar.gz
[rubygems/rubygems] Refactor Checksum classes and methods to reduce
code. (https://github.com/rubygems/rubygems/pull/6917) https://github.com/rubygems/rubygems/commit/2238bdaadc
Diffstat (limited to 'lib/bundler/lockfile_generator.rb')
-rw-r--r--lib/bundler/lockfile_generator.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/bundler/lockfile_generator.rb b/lib/bundler/lockfile_generator.rb
index 4d2c2c2a86..8114c27917 100644
--- a/lib/bundler/lockfile_generator.rb
+++ b/lib/bundler/lockfile_generator.rb
@@ -69,10 +69,12 @@ module Bundler
def add_checksums
out << "\nCHECKSUMS\n"
- empty_store = Checksum::Store.new
-
definition.resolve.sort_by(&:full_name).each do |spec|
- out << (spec.source.checksum_store || empty_store)[spec].to_lock
+ lock_name = GemHelpers.lock_name(spec.name, spec.version, spec.platform)
+ out << " #{lock_name}"
+ checksums = spec.source.checksum_store.checksums(spec.full_name)
+ out << " #{checksums.map(&:to_lock).sort.join(",")}" if checksums
+ out << "\n"
end
end