Created
September 2, 2009 11:39
-
-
Save thbar/179662 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 9313f5fb34d7e998cd90f49279977f0417ab2a5e Mon Sep 17 00:00:00 2001 | |
From: =?UTF-8?q?Thibaut=20Barr=C3=A8re?= <[email protected]> | |
Date: Wed, 2 Sep 2009 13:38:10 +0200 | |
Subject: [PATCH] Required patch for Ramaze | |
--- | |
.../lib/thinking_sphinx/configuration.rb | 2 ++ | |
gems/thinking-sphinx/lib/thinking_sphinx/tasks.rb | 15 ++++++++++----- | |
2 files changed, 12 insertions(+), 5 deletions(-) | |
diff --git a/gems/thinking-sphinx/lib/thinking_sphinx/configuration.rb b/gems/thinking-sphinx/lib/thinking_sphinx/configuration.rb | |
index f20c2db..f1eff18 100644 | |
--- a/gems/thinking-sphinx/lib/thinking_sphinx/configuration.rb | |
+++ b/gems/thinking-sphinx/lib/thinking_sphinx/configuration.rb | |
@@ -64,6 +64,8 @@ module ThinkingSphinx | |
:pid_file, :searchd_file_path, :address, :port, :allow_star, | |
:database_yml_file, :app_root, :bin_path, :model_directories, | |
:delayed_job_priority, :searchd_binary_name, :indexer_binary_name | |
+ | |
+ attr_accessor :app_env_task | |
attr_accessor :source_options, :index_options | |
diff --git a/gems/thinking-sphinx/lib/thinking_sphinx/tasks.rb b/gems/thinking-sphinx/lib/thinking_sphinx/tasks.rb | |
index 05ec377..c0fa9f4 100644 | |
--- a/gems/thinking-sphinx/lib/thinking_sphinx/tasks.rb | |
+++ b/gems/thinking-sphinx/lib/thinking_sphinx/tasks.rb | |
@@ -2,12 +2,17 @@ require 'fileutils' | |
namespace :thinking_sphinx do | |
task :app_env do | |
- if defined?(RAILS_ROOT) | |
- Rake::Task[:environment].invoke | |
- Rails.configuration.cache_classes = false | |
- end | |
+ custom_task = ThinkingSphinx::Configuration.instance.app_env_task | |
+ if custom_task | |
+ Rake::Task[custom_task].invoke | |
+ else | |
+ if defined?(RAILS_ROOT) | |
+ Rake::Task[:environment].invoke | |
+ Rails.configuration.cache_classes = false | |
+ end | |
- Rake::Task[:merb_env].invoke if defined?(Merb) | |
+ Rake::Task[:merb_env].invoke if defined?(Merb) | |
+ end | |
end | |
desc "Output the current Thinking Sphinx version" | |
-- | |
1.6.4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment