Sha256: 4d7a6948f99c4abb7e1f026ed8787991ab33cf70b4aaab69e46e44d1848b5a6c

Contents?: true

Size: 682 Bytes

Versions: 1

Compression:

Stored size: 682 Bytes

Contents

# A simple job class that processes a given index.
# 
class ThinkingSphinx::Deltas::DeltaJob
  attr_accessor :index
  
  # Initialises the object with an index name.
  # 
  # @param [String] index the name of the Sphinx index
  # 
  def initialize(index)
    @index = index
  end
  
  # Runs Sphinx's indexer tool to process the index. Currently assumes Sphinx is
  # running.
  # 
  # @return [Boolean] true
  # 
  def perform
    config = ThinkingSphinx::Configuration.instance
    
    output = `#{config.bin_path}#{config.indexer_binary_name} --config #{config.config_file} --rotate #{index}`
    puts output unless ThinkingSphinx.suppress_delta_output?
    
    true
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ts-delayed-delta-1.0.0 lib/thinking_sphinx/deltas/delayed_delta/delta_job.rb