Sha256: 7d92007003aad965f1cece10357a159d4922b2e8ba2cb169ed1d08e53cd6d2ec

Contents?: true

Size: 1.14 KB

Versions: 14

Compression:

Stored size: 1.14 KB

Contents

$:.unshift File.dirname(__FILE__) + '/../../lib'

require 'lib/thinking_sphinx'

%w( tmp/config tmp/log tmp/db/sphinx/development ).each do |path|
  FileUtils.mkdir_p "#{Dir.pwd}/#{path}"
end

Kernel.const_set :RAILS_ROOT, "#{Dir.pwd}/tmp" unless defined?(RAILS_ROOT)

at_exit do
  ThinkingSphinx::Configuration.instance.controller.stop
  sleep(1) # Ensure Sphinx has shut down completely
  ActiveRecord::Base.logger.close
  FileUtils.rm_r "#{Dir.pwd}/tmp"
end

# Add log file
ActiveRecord::Base.logger = Logger.new open("tmp/active_record.log", "a")

# Set up database tables
Dir["features/support/db/migrations/*.rb"].each do |file|
  require file.gsub(/\.rb$/, '')
end

# Load Models
Dir["features/support/models/*.rb"].sort.each do |file|
  require file.gsub(/\.rb$/, '')
end

ThinkingSphinx.deltas_enabled = false

# Load Fixtures
Dir["features/support/db/fixtures/*.rb"].each do |file|
  require file.gsub(/\.rb$/, '')
end

ThinkingSphinx.deltas_enabled = true
ThinkingSphinx.suppress_delta_output = true

ThinkingSphinx::Configuration.instance.build
ThinkingSphinx::Configuration.instance.controller.index
ThinkingSphinx::Configuration.instance.controller.start

Version data entries

14 entries across 14 versions & 4 rubygems

Version Path
thinking-sphinx-1.3.4 features/support/post_database.rb
thinking-sphinx-1.3.3 features/support/post_database.rb
thinking-sphinx-099-1.3.2 features/support/post_database.rb
thinking-sphinx-1.3.2 features/support/post_database.rb
moneypools-thinking-sphinx-1.3.1 features/support/post_database.rb
thinking-sphinx-1.3.1 features/support/post_database.rb
thinking-sphinx-099-1.3.1 features/support/post_database.rb
thinking-sphinx-099-1.3.0 features/support/post_database.rb
thinking-sphinx-1.3.0 features/support/post_database.rb
thinking-sphinx-099-1.2.13 features/support/post_database.rb
thinking-sphinx-1.2.13 features/support/post_database.rb
moneypools-thinking-sphinx-1.2.13 features/support/post_database.rb
moneypools-thinking-sphinx-1.2.12 features/support/post_database.rb
warp-thinking-sphinx-1.2.12 features/support/post_database.rb