[rubygems/rubygems] Refactor: Move filesystem access into Definition class

https://github.com/rubygems/rubygems/commit/2720da2659
This commit is contained in:
Franz Liedke 2023-12-02 20:03:39 +01:00 коммит произвёл git
Родитель 0ec88b54f3
Коммит 0653fb026c
2 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -64,7 +64,6 @@ module Bundler
file = file ? File.expand_path(file) : Bundler.default_lockfile
puts "Writing lockfile to #{file}"
definition.lock(file)
FileUtils.touch(file)
end
end

Просмотреть файл

@ -342,7 +342,10 @@ module Bundler
preserve_unknown_sections ||= !updating_major && (Bundler.frozen_bundle? || !(unlocking? || @unlocking_bundler))
return if file && File.exist?(file) && lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
if file && File.exist?(file) && lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
FileUtils.touch(file)
return
end
if Bundler.frozen_bundle?
Bundler.ui.error "Cannot write a changed lockfile while frozen."