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

Version Path
lalala-4.1.0.dev.324 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.322 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.321 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.318 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.316 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.314 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.0.0.dev.313 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.309 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.305 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.299 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.0.0.dev.291 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.0.0.dev.288 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.0.0.dev.285 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.0.0.dev.284 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.0.0.dev.283 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.0.0.dev.279 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.0.0.dev.277 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.0.0.dev.275 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.0.0.dev.269 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.0.0.dev.267 lib/lalala/ext_with_advisory_lock/flock.rb