[rubygems/rubygems] Use mkdir_p helper in bundler.rb

Small refactor, no functional change

https://github.com/rubygems/rubygems/commit/5edb7a1026
This commit is contained in:
Samuel Giddins 2023-12-14 10:10:49 +08:00 committed by git
parent 474b4c42f4
commit 5a66ea23d2

View File

@ -100,9 +100,7 @@ module Bundler
end
def create_bundle_path
SharedHelpers.filesystem_access(bundle_path.to_s) do |p|
mkdir_p(p)
end unless bundle_path.exist?
mkdir_p(bundle_path) unless bundle_path.exist?
@bundle_path = bundle_path.realpath
rescue Errno::EEXIST
@ -119,7 +117,7 @@ module Bundler
@bin_path ||= begin
path = settings[:bin] || "bin"
path = Pathname.new(path).expand_path(root).expand_path
SharedHelpers.filesystem_access(path) {|p| FileUtils.mkdir_p(p) }
mkdir_p(path)
path
end
end
@ -483,7 +481,7 @@ module Bundler
configured_bundle_path.use_system_gems?
end
def mkdir_p(path, options = {})
def mkdir_p(path)
SharedHelpers.filesystem_access(path, :write) do |p|
FileUtils.mkdir_p(p)
end