Sha256: 55cc510a8ff380ee16005dedbc79a7076ee6c7ab9b9e263b4b1a21ffdefbede5
Contents?: true
Size: 450 Bytes
Versions: 174
Compression:
Stored size: 450 Bytes
Contents
module Lalala::ExtWithAdvisoryLock::Flock extend ActiveSupport::Concern included do remove_method :filename alias_method :filename, :_ng_filename end def _ng_filename @filename ||= begin safe = @lock_name.gsub(/[^a-z0-9]/i, '') fn = "lock-#{safe}-#{@lock_name.to_s.hash}" dir = File.join(Rails.application.paths['tmp'].first, 'locks') FileUtils.mkdir_p(dir) File.join(dir, fn) end end end
Version data entries
174 entries across 174 versions & 1 rubygems