Sha256: 8442666afd1781d97617144c830657a8a28fad1e4a0f1de3ae9f81e006091779

Contents?: true

Size: 555 Bytes

Versions: 2

Compression:

Stored size: 555 Bytes

Contents

# frozen_string_literal: true

module Bundler
  class ProcessLock
    def self.lock(bundle_path = Bundler.bundle_path, &block)
      lock_file_path = File.join(bundle_path, "bundler.lock")
      base_lock_file_path = lock_file_path.delete_suffix(".lock")

      require "fileutils" if Bundler.rubygems.provides?("< 3.5.23")

      begin
        SharedHelpers.filesystem_access(lock_file_path, :write) do
          Gem.open_file_with_lock(base_lock_file_path, &block)
        end
      rescue PermissionError
        block.call
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
rubygems-update-3.5.23 bundler/lib/bundler/process_lock.rb
bundler-2.5.23 lib/bundler/process_lock.rb