Sha256: 79d5c06ae412d84ad4b238e34e4ccf401419f87ebc4abd6089036f6a74db4daa

Contents?: true

Size: 368 Bytes

Versions: 2

Compression:

Stored size: 368 Bytes

Contents

class ThinkingSphinx::Guard::File
  attr_reader :name

  def initialize(name)
    @name = name
  end

  def lock
    FileUtils.touch path
  end

  def locked?
    File.exists? path
  end

  def path
    @path ||= File.join(
      ThinkingSphinx::Configuration.instance.indices_location,
      "ts-#{name}.tmp"
    )
  end

  def unlock
    FileUtils.rm path
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
thinking-sphinx-3.1.3 lib/thinking_sphinx/guard/file.rb
thinking-sphinx-3.1.2 lib/thinking_sphinx/guard/file.rb