Sha256: 2551bc7f18a4e9312a80b7be1e55f245233ff2cdc19cfc82a603ca6f64524377
Contents?: true
Size: 369 Bytes
Versions: 34
Compression:
Stored size: 369 Bytes
Contents
module Fontist module Utils module Locking def lock(lock_path) File.dirname(lock_path).tap do |dir| FileUtils.mkdir_p(dir) unless File.exist?(dir) end f = File.open(lock_path, File::CREAT) f.flock(File::LOCK_EX) yield ensure f.flock(File::LOCK_UN) f.close end end end end
Version data entries
34 entries across 34 versions & 1 rubygems