lib/thinking_sphinx/tasks.rb in freelancing-god-thinking-sphinx-1.1.24 vs lib/thinking_sphinx/tasks.rb in freelancing-god-thinking-sphinx-1.2.0
- old
+ new
@@ -28,11 +28,11 @@
FileUtils.mkdir_p config.searchd_file_path
raise RuntimeError, "searchd is already running." if sphinx_running?
Dir["#{config.searchd_file_path}/*.spl"].each { |file| File.delete(file) }
- system! "#{config.bin_path}#{config.searchd_binary_name} --pidfile --config #{config.config_file}"
+ system! "#{config.bin_path}#{config.searchd_binary_name} --pidfile --config \"#{config.config_file}\""
sleep(2)
if sphinx_running?
puts "Started successfully (pid #{sphinx_pid})."
@@ -44,11 +44,11 @@
desc "Stop Sphinx using Thinking Sphinx's settings"
task :stop => :app_env do
raise RuntimeError, "searchd is not running." unless sphinx_running?
config = ThinkingSphinx::Configuration.instance
pid = sphinx_pid
- system! "#{config.bin_path}#{config.searchd_binary_name} --stop --config #{config.config_file}"
+ system! "#{config.bin_path}#{config.searchd_binary_name} --stop --config \"#{config.config_file}\""
puts "Stopped search daemon (pid #{pid})."
end
desc "Restart Sphinx"
task :restart => [:app_env, :stop, :start]
@@ -69,10 +69,10 @@
puts "Generating Configuration to #{config.config_file}"
config.build
end
FileUtils.mkdir_p config.searchd_file_path
- cmd = "#{config.bin_path}#{config.indexer_binary_name} --config #{config.config_file} --all"
+ cmd = "#{config.bin_path}#{config.indexer_binary_name} --config \"#{config.config_file}\" --all"
cmd << " --rotate" if sphinx_running?
system! cmd
end