class ThinkingSphinx::Controller

Public Instance Methods

guard_file(index) click to toggle source
# File lib/thinking_sphinx/controller.rb, line 14
def guard_file(index)
  File.join(
    ThinkingSphinx::Configuration.instance.indices_location,
    "ts-#{index}.tmp"
  )
end
index(*indices) click to toggle source
Calls superclass method
# File lib/thinking_sphinx/controller.rb, line 2
def index(*indices)
  options = indices.extract_options!
  indices << '--all' if indices.empty?

  indices = indices.reject { |index| File.exists? guard_file(index) }
  return if indices.empty?

  indices.each { |index| FileUtils.touch guard_file(index) }
  super(*(indices + [options]))
  indices.each { |index| FileUtils.rm guard_file(index) }
end