class ThinkingSphinx::Guard::File
Attributes
name[R]
Public Class Methods
new(name)
click to toggle source
# File lib/thinking_sphinx/guard/file.rb, line 4 def initialize(name) @name = name end
Public Instance Methods
lock()
click to toggle source
# File lib/thinking_sphinx/guard/file.rb, line 8 def lock FileUtils.touch path end
locked?()
click to toggle source
# File lib/thinking_sphinx/guard/file.rb, line 12 def locked? File.exists? path end
path()
click to toggle source
# File lib/thinking_sphinx/guard/file.rb, line 16 def path @path ||= File.join( ThinkingSphinx::Configuration.instance.indices_location, "ts-#{name}.tmp" ) end
unlock()
click to toggle source
# File lib/thinking_sphinx/guard/file.rb, line 23 def unlock FileUtils.rm path end