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.425 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.420 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.419 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.418 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.417 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.0.0.dev.416 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.415 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.414 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.413 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.412 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.411 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.410 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.409 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.0.0.dev.407 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.408 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.398 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.397 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.0.0.dev.396 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.0.0.dev.395 lib/lalala/ext_with_advisory_lock/flock.rb
lalala-4.1.0.dev.394 lib/lalala/ext_with_advisory_lock/flock.rb