diff options
| author | hukl <contact@smyck.org> | 2011-02-10 14:19:00 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2011-02-10 14:19:00 +0100 |
| commit | 7379daad1c73bd3610ed296436250b417ac3673d (patch) | |
| tree | 04f722efc678de9d3aa5bf8f1c96e3be33b18bc4 /vendor/plugins/thinking-sphinx/features/support/post_database.rb | |
| parent | 91633ac4419d839661e35ae8f2efe5c9089cfb67 (diff) | |
removed thinking_sphinx plugin and replaced it with gem.
also tuned dependencies
Diffstat (limited to 'vendor/plugins/thinking-sphinx/features/support/post_database.rb')
| -rw-r--r-- | vendor/plugins/thinking-sphinx/features/support/post_database.rb | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/vendor/plugins/thinking-sphinx/features/support/post_database.rb b/vendor/plugins/thinking-sphinx/features/support/post_database.rb deleted file mode 100644 index 51cefb5..0000000 --- a/vendor/plugins/thinking-sphinx/features/support/post_database.rb +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | $:.unshift File.dirname(__FILE__) + '/../../lib' | ||
| 2 | |||
| 3 | require 'lib/thinking_sphinx' | ||
| 4 | |||
| 5 | %w( tmp/config tmp/log tmp/db/sphinx/development ).each do |path| | ||
| 6 | FileUtils.mkdir_p "#{Dir.pwd}/#{path}" | ||
| 7 | end | ||
| 8 | |||
| 9 | Kernel.const_set :RAILS_ROOT, "#{Dir.pwd}/tmp" unless defined?(RAILS_ROOT) | ||
| 10 | |||
| 11 | at_exit do | ||
| 12 | ThinkingSphinx::Configuration.instance.controller.stop | ||
| 13 | sleep(1) # Ensure Sphinx has shut down completely | ||
| 14 | FileUtils.rm_r "#{Dir.pwd}/tmp" | ||
| 15 | end | ||
| 16 | |||
| 17 | # Add log file | ||
| 18 | ActiveRecord::Base.logger = Logger.new open("tmp/active_record.log", "a") | ||
| 19 | |||
| 20 | ThinkingSphinx.deltas_enabled = false | ||
| 21 | |||
| 22 | # Load Models | ||
| 23 | Dir["features/support/models/*.rb"].sort.each do |file| | ||
| 24 | require file.gsub(/\.rb$/, '') | ||
| 25 | end | ||
| 26 | |||
| 27 | # Set up database tables and records | ||
| 28 | Dir["features/support/db/migrations/*.rb"].each do |file| | ||
| 29 | require file.gsub(/\.rb$/, '') | ||
| 30 | end | ||
| 31 | |||
| 32 | ThinkingSphinx.deltas_enabled = true | ||
| 33 | ThinkingSphinx.suppress_delta_output = true | ||
| 34 | |||
| 35 | ThinkingSphinx::Configuration.instance.build | ||
| 36 | ThinkingSphinx::Configuration.instance.controller.index | ||
| 37 | ThinkingSphinx::Configuration.instance.controller.start | ||
