Sha256: e1257f2e5d1f299a1fff613b207d1fa9e13e25f800fb3170b9bebf7ca84b9223
Contents?: true
Size: 407 Bytes
Versions: 16
Compression:
Stored size: 407 Bytes
Contents
require 'dply/helper' module Dply class Lock include Helper def initialize(dir) @dir = dir end def acquire logger.debug "acquiring lock" lock_acquired = lock_file.flock(File::LOCK_NB | File::LOCK_EX) error "exclusive lock not available" if not lock_acquired end def lock_file @lock_file ||= File.open("#{@dir}/.dply.lock", "a+") end end end
Version data entries
16 entries across 16 versions & 1 rubygems