mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
[rubygems/rubygems] Small simplification in Definition class
https://github.com/rubygems/rubygems/commit/03ddfd7610 Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
This commit is contained in:
parent
364cc95897
commit
12d7ead043
@ -511,11 +511,7 @@ module Bundler
|
||||
end
|
||||
|
||||
def lockfile_exists?
|
||||
file_exists?(lockfile)
|
||||
end
|
||||
|
||||
def file_exists?(file)
|
||||
file && File.exist?(file)
|
||||
lockfile && File.exist?(lockfile)
|
||||
end
|
||||
|
||||
def write_lock(file, preserve_unknown_sections)
|
||||
@ -536,7 +532,7 @@ module Bundler
|
||||
|
||||
preserve_unknown_sections ||= !updating_major && (Bundler.frozen_bundle? || !(unlocking? || @unlocking_bundler))
|
||||
|
||||
if file_exists?(file) && lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
|
||||
if File.exist?(file) && lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
|
||||
return if Bundler.frozen_bundle?
|
||||
SharedHelpers.filesystem_access(file) { FileUtils.touch(file) }
|
||||
return
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user