class ThinkingSphinx::Test
Public Class Methods
autostop()
click to toggle source
# File lib/thinking_sphinx/test.rb, line 25 def self.autostop Kernel.at_exit do ThinkingSphinx::Test.stop end end
clear()
click to toggle source
# File lib/thinking_sphinx/test.rb, line 40 def self.clear [ config.indices_location, config.searchd.binlog_path ].each do |path| FileUtils.rm_r(path) if File.exists?(path) end end
config()
click to toggle source
# File lib/thinking_sphinx/test.rb, line 49 def self.config @config ||= ::ThinkingSphinx::Configuration.instance end
index(*indexes)
click to toggle source
# File lib/thinking_sphinx/test.rb, line 53 def self.index(*indexes) config.controller.index *indexes end
init(suppress_delta_output = true)
click to toggle source
# File lib/thinking_sphinx/test.rb, line 4 def self.init(suppress_delta_output = true) FileUtils.mkdir_p config.indices_location config.settings['quiet_deltas'] = suppress_delta_output end
run() { || ... }
click to toggle source
# File lib/thinking_sphinx/test.rb, line 31 def self.run(&block) begin start yield ensure stop end end
start(options = {})
click to toggle source
# File lib/thinking_sphinx/test.rb, line 9 def self.start(options = {}) config.render_to_file config.controller.index if options[:index].nil? || options[:index] config.controller.start end
start_with_autostop()
click to toggle source
# File lib/thinking_sphinx/test.rb, line 15 def self.start_with_autostop autostop start end
stop()
click to toggle source
# File lib/thinking_sphinx/test.rb, line 20 def self.stop config.controller.stop sleep(0.5) # Ensure Sphinx has shut down completely end